From 78020b1946e5e287e920be2d09bdac7fc4ec9c29 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 17 Mar 2025 12:51:38 +0800 Subject: [PATCH 01/13] update dependency --- packages/typespec-python/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 5ef6d61a4b3..704b280f5ea 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -54,7 +54,7 @@ "@azure-tools/typespec-azure-resource-manager": ">=0.52.0 <1.0.0", "@azure-tools/typespec-autorest": ">=0.52.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.52.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.52.0 <1.0.0" + "@azure-tools/typespec-client-generator-core": "0.53.0-dev.23" }, "dependencies": { "js-yaml": "~4.1.0", @@ -73,7 +73,7 @@ "@azure-tools/typespec-azure-core": "~0.52.0", "@azure-tools/typespec-azure-rulesets": "~0.52.0", "@azure-tools/typespec-autorest": "~0.52.0", - "@azure-tools/typespec-client-generator-core": "~0.52.0", + "@azure-tools/typespec-client-generator-core": "0.53.0-dev.23", "@azure-tools/azure-http-specs": "0.1.0-alpha.7", "@typespec/http-specs": "0.1.0-alpha.11", "@types/js-yaml": "~4.0.5", From 24d0e9801899a8ebdcce3cfe4d4b1f8f7e7b6555 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 17 Mar 2025 04:58:12 +0000 Subject: [PATCH 02/13] update dependency --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- pnpm-lock.yaml | 319 ++++++++++++++++---------- 3 files changed, 194 insertions(+), 129 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 04da48fc4a7..45971037109 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "~0.7.1", + "@typespec/http-client-python": "/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 704b280f5ea..3e3a564c491 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.7.1", + "@typespec/http-client-python": "/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6d93bca418..1856c7bde8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.7.1 - version: 0.7.1(okmb572npleddk7eu2wecik6ue) + specifier: /workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz + version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.7.1 - version: 0.7.1(phqovtct7xb2vaqtokn2tbhedm) + specifier: /workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz + version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(lg66nywn6yumq23sbt2w2cb32e) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -96,22 +96,22 @@ importers: devDependencies: '@azure-tools/azure-http-specs': specifier: 0.1.0-alpha.7 - version: 0.1.0-alpha.7(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + version: 0.1.0-alpha.7(vv5y5mczssczr6kdmnzvay4nom) '@azure-tools/typespec-autorest': specifier: ~0.52.0 - version: 0.52.0(3rl4rvlhrau42sgbqnofgdnzru) + version: 0.52.0(pg6owiqeffjzatemiiau7ohgpu) '@azure-tools/typespec-azure-core': specifier: ~0.52.0 - version: 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + version: 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': specifier: ~0.52.0 - version: 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + version: 0.52.0(224lxb5xc4rbgp4f6qmcotsbna) '@azure-tools/typespec-azure-rulesets': specifier: ~0.52.0 - version: 0.52.0(hnvyb6ssbaiolad3f2jkopuscy) + version: 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.52.0(224lxb5xc4rbgp4f6qmcotsbna))(@azure-tools/typespec-client-generator-core@0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4))(@typespec/compiler@0.66.0(@types/node@22.5.5)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.52.0 - version: 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + specifier: 0.53.0-dev.23 + version: 0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -132,16 +132,16 @@ importers: version: 0.66.0(@types/node@22.5.5) '@typespec/http': specifier: ~0.66.0 - version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) '@typespec/http-specs': specifier: 0.1.0-alpha.11 - version: 0.1.0-alpha.11(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + version: 0.1.0-alpha.11(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) '@typespec/openapi': specifier: ~0.66.0 - version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) '@typespec/rest': specifier: ~0.66.0 - version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) '@typespec/versioning': specifier: ~0.66.0 version: 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) @@ -231,17 +231,20 @@ packages: '@azure-tools/typespec-client-generator-core': ~0.52.0 '@typespec/compiler': ~0.66.0 - '@azure-tools/typespec-client-generator-core@0.52.0': - resolution: {integrity: sha512-P1kh4mkqPmZY0JsJAtnTRDjzynI05TybgRTsaEnQtFwnlbfUzu1KtKDF4midQDMT6Ao8JEt/S2Nd4nQ1/qrHyQ==} - engines: {node: '>=18.0.0'} + '@azure-tools/typespec-client-generator-core@0.53.0-dev.23': + resolution: {integrity: sha512-GGCGwFuZt7eBpeM1G/l3jts4f9x4jKN20t8OpIiL9E+rHOckq+gjDmt9mz/se3eRcJSltxL53R6qGpmWto7mZA==} + engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.52.0 - '@typespec/compiler': ~0.66.0 - '@typespec/http': ~0.66.0 - '@typespec/openapi': ~0.66.0 - '@typespec/rest': ~0.66.0 - '@typespec/versioning': ~0.66.0 - '@typespec/xml': ~0.66.0 + '@azure-tools/typespec-azure-core': ^0.52.0 || >=0.53.0-dev <0.53.0 + '@typespec/compiler': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/events': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/http': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/openapi': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/rest': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/sse': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/streams': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/versioning': ^0.66.0 || >=0.67.0-dev <0.67.0 + '@typespec/xml': ^0.66.0 || >=0.67.0-dev <0.67.0 '@azure/abort-controller@2.1.2': resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==} @@ -1613,15 +1616,22 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - '@typespec/http-client-python@0.7.1': - resolution: {integrity: sha512-inuY6Fp1oJXZMMc+qlCHqrAiy/DKm1olFDjplBhnaGZKUb3pgkj22CdNbYoPje3U7o1LDq7vxKZi90PAB4ftVw==} + '@typespec/events@0.66.0': + resolution: {integrity: sha512-I0FlzJhLxhxPKzp+qfjQECIoKQJwuS/GpR9SaArYsroyL6YUZmwpyDHHbYDQ7/VHU/sRFJGvgVfDPhpooghlqA==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@typespec/compiler': ~0.66.0 + + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz': + resolution: {integrity: sha512-OhF1F7tcyBv9Q1Vqs/wPYzt9bgSrQ8nb6b9UziVf4p4qTXxPqhOT6IG14LLNTpjkWyUtFgvcNQN/m4bvtXbY+A==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz} + version: 0.7.1 engines: {node: '>=18.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.52.0 <1.0.0' '@azure-tools/typespec-azure-core': '>=0.52.0 <1.0.0' '@azure-tools/typespec-azure-resource-manager': '>=0.52.0 <1.0.0' '@azure-tools/typespec-azure-rulesets': '>=0.52.0 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.52.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23 '@typespec/compiler': '>=0.66.0 <1.0.0' '@typespec/http': '>=0.66.0 <1.0.0' '@typespec/openapi': '>=0.66.0 <1.0.0' @@ -1675,6 +1685,21 @@ packages: engines: {node: '>=16.0.0'} hasBin: true + '@typespec/sse@0.66.0': + resolution: {integrity: sha512-Aa/pLy9i/lIdPwpT7uv4aycap96LGQIZg5I/k2tc4kfU9cmEo0c3tDwAiu7rRBEobdjKh+neiY8ulwt/HS4x8Q==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@typespec/compiler': ~0.66.0 + '@typespec/events': ~0.66.0 + '@typespec/http': ~0.66.0 + '@typespec/streams': ~0.66.0 + + '@typespec/streams@0.66.0': + resolution: {integrity: sha512-W7qtcn+l6/eTkCS3ux7/BAjWBYebbCQ1K4dHtuhBYrjOJOkHWE27hzeTUWuNwY5YwKrIe0ln1Jmf9iPaUUw5tQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@typespec/compiler': ~0.66.0 + '@typespec/versioning@0.66.0': resolution: {integrity: sha512-8AhTpo6jxcjwxZPAegI/sDEePoqXz5Si8XBw/x7jz+EkBvbgqT9GT0UUzJL1XgOwQaks2aMr4DdOn8n9kOCltg==} engines: {node: '>=18.0.0'} @@ -4654,14 +4679,14 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.7(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@azure-tools/azure-http-specs@0.1.0-alpha.7(vv5y5mczssczr6kdmnzvay4nom)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.1 - '@typespec/spector': 0.1.0-alpha.8(@types/node@22.5.5) + '@typespec/spector': 0.1.0-alpha.8(@types/node@22.5.5)(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) '@typespec/xml': 0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) transitivePeerDependencies: @@ -4672,96 +4697,102 @@ snapshots: - debug - supports-color - '@azure-tools/typespec-autorest@0.52.0(3rl4rvlhrau42sgbqnofgdnzru)': - dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - - '@azure-tools/typespec-autorest@0.52.0(6uu33tjguzoy44vb3pkhjaszly)': + '@azure-tools/typespec-autorest@0.52.0(fdk2ckafnfmhv6wo6zuksvolgu)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(thq34doc255nh6kovajegjwqt4) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e) '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))': + '@azure-tools/typespec-autorest@0.52.0(pg6owiqeffjzatemiiau7ohgpu)': + dependencies: + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(224lxb5xc4rbgp4f6qmcotsbna) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4) + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + + '@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) - '@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))': + '@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) - '@azure-tools/typespec-azure-resource-manager@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': + '@azure-tools/typespec-azure-resource-manager@0.52.0(224lxb5xc4rbgp4f6qmcotsbna)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) - '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-resource-manager@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@azure-tools/typespec-azure-resource-manager@0.52.0(thq34doc255nh6kovajegjwqt4)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) - '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) + '@typespec/compiler': 0.66.0(@types/node@22.10.10) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.52.0(eqsyztd2tvlx3c3vm7av2vzyaa)': + '@azure-tools/typespec-azure-rulesets@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))))(@azure-tools/typespec-azure-resource-manager@0.52.0(thq34doc255nh6kovajegjwqt4))(@azure-tools/typespec-client-generator-core@0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e))(@typespec/compiler@0.66.0(@types/node@22.10.10))': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(thq34doc255nh6kovajegjwqt4) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e) '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@azure-tools/typespec-azure-rulesets@0.52.0(hnvyb6ssbaiolad3f2jkopuscy)': + '@azure-tools/typespec-azure-rulesets@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.52.0(224lxb5xc4rbgp4f6qmcotsbna))(@azure-tools/typespec-client-generator-core@0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4))(@typespec/compiler@0.66.0(@types/node@22.5.5))': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(224lxb5xc4rbgp4f6qmcotsbna) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4) '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@azure-tools/typespec-client-generator-core@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': + '@azure-tools/typespec-client-generator-core@0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/events': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/sse': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) '@typespec/xml': 0.59.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) change-case: 5.4.4 pluralize: 8.0.0 yaml: 2.7.0 - '@azure-tools/typespec-client-generator-core@0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@azure-tools/typespec-client-generator-core@0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4)': dependencies: - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/events': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/sse': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) '@typespec/xml': 0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) change-case: 5.4.4 @@ -6440,18 +6471,26 @@ snapshots: - bluebird - supports-color - '@typespec/http-client-python@0.7.1(okmb572npleddk7eu2wecik6ue)': + '@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': dependencies: - '@azure-tools/typespec-autorest': 0.52.0(6uu33tjguzoy44vb3pkhjaszly) - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@azure-tools/typespec-azure-rulesets': 0.52.0(eqsyztd2tvlx3c3vm7av2vzyaa) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))))(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + + '@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))': + dependencies: + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(lg66nywn6yumq23sbt2w2cb32e)': + dependencies: + '@azure-tools/typespec-autorest': 0.52.0(pg6owiqeffjzatemiiau7ohgpu) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(224lxb5xc4rbgp4f6qmcotsbna) + '@azure-tools/typespec-azure-rulesets': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.52.0(224lxb5xc4rbgp4f6qmcotsbna))(@azure-tools/typespec-client-generator-core@0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4))(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(dkjxknbyittfrupdfnf4j6mhu4) + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) + '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -6461,18 +6500,18 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.7.1(phqovtct7xb2vaqtokn2tbhedm)': + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi)': dependencies: - '@azure-tools/typespec-autorest': 0.52.0(3rl4rvlhrau42sgbqnofgdnzru) - '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) - '@azure-tools/typespec-azure-resource-manager': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@azure-tools/typespec-azure-rulesets': 0.52.0(hnvyb6ssbaiolad3f2jkopuscy) - '@azure-tools/typespec-client-generator-core': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@azure-tools/typespec-autorest': 0.52.0(fdk2ckafnfmhv6wo6zuksvolgu) + '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.52.0(thq34doc255nh6kovajegjwqt4) + '@azure-tools/typespec-azure-rulesets': 0.52.0(@azure-tools/typespec-azure-core@0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))))(@azure-tools/typespec-azure-resource-manager@0.52.0(thq34doc255nh6kovajegjwqt4))(@azure-tools/typespec-client-generator-core@0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e))(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@azure-tools/typespec-client-generator-core': 0.53.0-dev.23(cajwcafl3kc3bnwupaxjgylc2e) + '@typespec/compiler': 0.66.0(@types/node@22.10.10) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))) + '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -6482,13 +6521,13 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-specs@0.1.0-alpha.11(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@typespec/http-specs@0.1.0-alpha.11(@types/node@22.5.5)(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.1 - '@typespec/spector': 0.1.0-alpha.8(@types/node@22.5.5) + '@typespec/spector': 0.1.0-alpha.8(@types/node@22.5.5)(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) '@typespec/xml': 0.59.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) transitivePeerDependencies: @@ -6499,33 +6538,37 @@ snapshots: - debug - supports-color - '@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': + '@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) + optionalDependencies: + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))': + '@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) + optionalDependencies: + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': + '@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@typespec/openapi@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) - '@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': + '@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + '@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) '@typespec/spec-api@0.1.0-alpha.1': dependencies: @@ -6552,13 +6595,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typespec/spector@0.1.0-alpha.8(@types/node@22.5.5)': + '@typespec/spector@0.1.0-alpha.8(@types/node@22.5.5)(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': dependencies: '@azure/identity': 4.6.0 '@types/js-yaml': 4.0.9 '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.1 '@typespec/spec-coverage-sdk': 0.1.0-alpha.3 '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) @@ -6588,6 +6631,28 @@ snapshots: - debug - supports-color + '@typespec/sse@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)))': + dependencies: + '@typespec/compiler': 0.66.0(@types/node@22.10.10) + '@typespec/events': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) + + '@typespec/sse@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)))': + dependencies: + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + '@typespec/events': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))) + '@typespec/streams': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) + + '@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': + dependencies: + '@typespec/compiler': 0.66.0(@types/node@22.10.10) + + '@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))': + dependencies: + '@typespec/compiler': 0.66.0(@types/node@22.5.5) + '@typespec/versioning@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) From c402a5d4c2e6aafa009f329328d26bc424758745 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 17 Mar 2025 06:28:24 +0000 Subject: [PATCH 03/13] regen --- .../typespec-python/scripts/eng/regenerate.ts | 49 +- .../authentication-api-key/MANIFEST.in | 2 +- .../authentication-api-key/README.md | 4 +- .../generated/authentication-api-key/setup.py | 7 +- .../authentication-http-custom/MANIFEST.in | 2 +- .../authentication-http-custom/README.md | 8 +- .../authentication-http-custom/setup.py | 9 +- .../authentication-oauth2/MANIFEST.in | 2 +- .../generated/authentication-oauth2/README.md | 4 +- .../generated/authentication-oauth2/setup.py | 7 +- .../authentication-union/MANIFEST.in | 2 +- .../generated/authentication-union/README.md | 4 +- .../generated/authentication-union/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../apiview-properties.json | 8 +- .../setup.py | 7 +- .../clientgenerator/core/access/_client.py | 10 +- .../core/access/aio/_client.py | 10 +- .../core/access/aio/operations/__init__.py | 31 - .../core/access/aio/operations/_operations.py | 687 --- .../core/access/internaloperation/__init__.py | 1 + .../access/internaloperation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 250 ++ .../aio/operations/_patch.py | 0 .../internaloperation/models/__init__.py | 27 + .../internaloperation/models/_models.py | 97 + .../{ => internaloperation}/models/_patch.py | 0 .../internaloperation/operations/__init__.py | 25 + .../operations/_operations.py | 305 ++ .../operations/_patch.py | 0 .../core/access/operations/__init__.py | 31 - .../core/access/operations/_operations.py | 856 ---- .../core/access/publicoperation/__init__.py | 1 + .../access/publicoperation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 178 + .../publicoperation}/aio/operations/_patch.py | 0 .../{ => publicoperation}/models/__init__.py | 4 - .../access/publicoperation/models/_models.py | 69 + .../access/publicoperation/models}/_patch.py | 0 .../publicoperation/operations/__init__.py | 25 + .../publicoperation/operations/_operations.py | 218 + .../publicoperation/operations}/_patch.py | 0 .../relativemodelinoperation/__init__.py | 1 + .../relativemodelinoperation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 197 + .../aio/operations}/_patch.py | 0 .../models/__init__.py | 21 + .../models/_models.py | 174 +- .../models}/_patch.py | 0 .../operations/__init__.py | 25 + .../operations/_operations.py | 237 + .../operations}/_patch.py | 0 .../access/sharedmodelinoperation/__init__.py | 1 + .../sharedmodelinoperation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 176 + .../aio/operations/_patch.py | 0 .../sharedmodelinoperation/models/__init__.py | 27 + .../sharedmodelinoperation/models/_models.py | 41 + .../sharedmodelinoperation}/models/_patch.py | 0 .../operations/__init__.py | 25 + .../operations/_operations.py | 216 + .../operations/_patch.py | 0 .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../apiview-properties.json | 8 +- .../setup.py | 7 +- .../clientgenerator/core/usage/_client.py | 2 +- .../clientgenerator/core/usage/aio/_client.py | 2 +- .../core/usage/modelinoperation/__init__.py | 1 + .../usage/modelinoperation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 6 +- .../aio/operations/_patch.py | 0 .../usage/modelinoperation/models/__init__.py | 33 + .../usage/modelinoperation/models/_models.py | 111 + .../usage/modelinoperation/models}/_patch.py | 0 .../operations/__init__.py | 0 .../operations/_operations.py | 6 +- .../modelinoperation}/operations/_patch.py | 0 .../core/usage/models/__init__.py | 8 - .../core/usage/models/_models.py | 100 +- .../generated/azure-core-basic/MANIFEST.in | 2 +- .../generated/azure-core-basic/README.md | 4 +- .../azure/generated/azure-core-basic/setup.py | 7 +- .../azure-core-lro-standard/MANIFEST.in | 2 +- .../azure-core-lro-standard/README.md | 4 +- .../azure-core-lro-standard/setup.py | 7 +- .../generated/azure-core-model/MANIFEST.in | 2 +- .../generated/azure-core-model/README.md | 4 +- .../azure/generated/azure-core-model/setup.py | 7 +- .../generated/azure-core-page/MANIFEST.in | 2 +- .../azure/generated/azure-core-page/README.md | 4 +- .../azure/generated/azure-core-page/setup.py | 7 +- .../generated/azure-core-scalar/MANIFEST.in | 2 +- .../generated/azure-core-scalar/README.md | 4 +- .../generated/azure-core-scalar/setup.py | 7 +- .../generated/azure-core-traits/MANIFEST.in | 2 +- .../generated/azure-core-traits/README.md | 4 +- .../generated/azure-core-traits/setup.py | 7 +- .../generated/azure-example-basic/MANIFEST.in | 5 +- .../generated/azure-example-basic/README.md | 10 +- .../apiview-properties.json | 4 +- .../azureexamplebasicclient/__init__.py | 32 + .../_client.py | 0 .../_configuration.py | 2 +- .../_model_base.py | 0 .../_operations/__init__.py | 0 .../_operations/_operations.py | 14 +- .../_operations}/_patch.py | 0 .../azureexamplebasicclient}/_patch.py | 0 .../_serialization.py | 0 .../_vendor.py | 0 .../_version.py | 0 .../aio/__init__.py | 0 .../aio/_client.py | 0 .../aio/_configuration.py | 2 +- .../aio/_operations/__init__.py | 0 .../aio/_operations/_operations.py | 14 +- .../aio/_operations}/_patch.py | 0 .../azureexamplebasicclient/aio}/_patch.py | 0 .../aio/_vendor.py | 0 .../py.typed | 0 .../generated_samples/basic.py | 4 +- .../generated_tests/testpreparer.py | 2 +- .../generated_tests/testpreparer_async.py | 2 +- .../generated/azure-example-basic/setup.py | 17 +- .../specs/azure/example/basic/__init__.py | 33 +- .../azure/example/basic/models/_models.py | 10 +- .../azure-payload-pageable/MANIFEST.in | 2 +- .../azure-payload-pageable/README.md | 4 +- .../generated/azure-payload-pageable/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../azure-resource-manager-resources/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../generated/azurecore-lro-rpc/MANIFEST.in | 2 +- .../generated/azurecore-lro-rpc/README.md | 4 +- .../generated/azurecore-lro-rpc/setup.py | 7 +- .../generated/client-namespace/MANIFEST.in | 2 +- .../generated/client-namespace/README.md | 4 +- .../client-namespace/apiview-properties.json | 4 +- .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../second/_operations/_operations.py | 8 +- .../second/aio/_operations/_operations.py | 8 +- .../clientnamespace/second/models/_models.py | 6 +- .../generated_tests/conftest.py | 26 +- .../generated_tests/testpreparer.py | 20 +- .../generated_tests/testpreparer_async.py | 12 +- .../azure/generated/client-namespace/setup.py | 7 +- .../azure/generated/client-naming/MANIFEST.in | 2 +- .../azure/generated/client-naming/README.md | 4 +- .../client-naming/apiview-properties.json | 10 +- .../client-naming/client/naming/_client.py | 4 +- .../{operations => _operations}/__init__.py | 4 - .../_operations.py | 403 +- .../client/naming/_operations}/_patch.py | 0 .../client/naming/aio/_client.py | 4 +- .../{operations => _operations}/__init__.py | 4 - .../_operations.py | 347 +- .../client/naming/aio/_operations}/_patch.py | 0 .../client/naming/model/__init__.py | 1 + .../client/naming/model/aio/__init__.py | 1 + .../naming/model/aio/operations/__init__.py | 25 + .../model}/aio/operations/_operations.py | 94 +- .../naming/model/aio}/operations/_patch.py | 0 .../client/naming/model/models/__init__.py | 29 + .../client/naming/model/models/_models.py | 69 + .../client/naming/model/models}/_patch.py | 0 .../naming/model/operations/__init__.py | 25 + .../naming/model}/operations/_operations.py | 106 +- .../client/naming/model/operations}/_patch.py | 0 .../client/naming/property/__init__.py | 1 + .../naming/{ => property}/models/__init__.py | 11 - .../naming/{ => property}/models/_models.py | 60 +- .../client/naming/property/models}/_patch.py | 0 .../client/naming/unionenum/__init__.py | 1 + .../client/naming/unionenum/aio/__init__.py | 1 + .../unionenum/aio/operations/__init__.py | 25 + .../unionenum/aio/operations/_operations.py | 160 + .../unionenum}/aio/operations/_patch.py | 0 .../naming/unionenum/models/__init__.py | 29 + .../naming/{ => unionenum}/models/_enums.py | 0 .../client/naming/unionenum/models}/_patch.py | 0 .../naming/unionenum/operations/__init__.py | 25 + .../unionenum/operations/_operations.py | 189 + .../naming/unionenum}/operations/_patch.py | 0 .../azure/generated/client-naming/setup.py | 7 +- .../client-structure-default/MANIFEST.in | 2 +- .../client-structure-default/README.md | 4 +- .../client/structure/service/_client.py | 4 +- .../client/structure/service/aio/_client.py | 4 +- .../service/aio/operations/__init__.py | 4 - .../service/aio/operations/_operations.py | 214 - .../client/structure/service/baz/__init__.py | 1 + .../structure/service/baz/aio/__init__.py | 1 + .../service/baz/aio/operations/__init__.py | 25 + .../service/baz/aio/operations/_operations.py | 116 + .../service/baz/aio}/operations/_patch.py | 0 .../service/baz/operations/__init__.py | 25 + .../service/baz/operations/_operations.py | 125 + .../service/baz}/operations/_patch.py | 0 .../structure/service/operations/__init__.py | 4 - .../service/operations/_operations.py | 232 - .../client/structure/service/qux/__init__.py | 1 + .../structure/service/qux/aio/__init__.py | 1 + .../service/qux/aio/operations/__init__.py | 25 + .../service/qux/aio/operations/_operations.py | 161 + .../service/qux/aio/operations}/_patch.py | 0 .../service/qux/operations/__init__.py | 25 + .../service/qux/operations/_operations.py | 177 + .../service/qux}/operations/_patch.py | 0 .../client-structure-default/setup.py | 7 +- .../client-structure-multiclient/MANIFEST.in | 2 +- .../client-structure-multiclient/README.md | 4 +- .../client-structure-multiclient/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../azure/generated/encode-bytes/MANIFEST.in | 2 +- .../azure/generated/encode-bytes/README.md | 4 +- .../encode-bytes/encode/bytes/_client.py | 12 +- .../encode-bytes/encode/bytes/aio/_client.py | 12 +- .../encode/bytes/aio/operations/__init__.py | 33 - .../bytes/aio/operations/_operations.py | 1543 ------- .../encode/bytes/header/__init__.py | 1 + .../encode/bytes/header/aio/__init__.py | 1 + .../bytes/header}/aio/operations/__init__.py | 2 - .../header/aio/operations/_operations.py | 244 + .../bytes/header}/aio/operations/_patch.py | 0 .../bytes/header}/operations/__init__.py | 2 - .../bytes/header/operations/_operations.py | 292 ++ .../encode/bytes/header/operations}/_patch.py | 0 .../encode/bytes/operations/__init__.py | 33 - .../encode/bytes/operations/_operations.py | 1827 -------- .../encode/bytes/property/__init__.py | 1 + .../encode/bytes/property/aio/__init__.py | 1 + .../property}/aio/operations/__init__.py | 0 .../property/aio/operations/_operations.py | 541 +++ .../bytes/property/aio}/operations/_patch.py | 0 .../bytes/property}/operations/__init__.py | 0 .../bytes/property/operations/_operations.py | 606 +++ .../bytes/property}/operations/_patch.py | 0 .../encode/bytes/query/__init__.py | 1 + .../encode/bytes/query/aio/__init__.py | 1 + .../bytes/query/aio/operations/__init__.py | 25 + .../bytes/query/aio/operations/_operations.py | 244 + .../bytes/query/aio}/operations/_patch.py | 0 .../encode/bytes/query/operations/__init__.py | 25 + .../bytes/query/operations/_operations.py | 292 ++ .../encode/bytes/query}/operations/_patch.py | 0 .../encode/bytes/requestbody/__init__.py | 1 + .../encode/bytes/requestbody/aio/__init__.py | 1 + .../requestbody/aio/operations/__init__.py | 25 + .../requestbody/aio/operations/_operations.py | 315 ++ .../requestbody/aio}/operations/_patch.py | 0 .../bytes/requestbody/operations/__init__.py | 25 + .../requestbody/operations/_operations.py | 378 ++ .../bytes/requestbody}/operations/_patch.py | 0 .../encode/bytes/responsebody/__init__.py | 1 + .../encode/bytes/responsebody/aio/__init__.py | 1 + .../responsebody/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 170 +- .../responsebody/aio}/operations/_patch.py | 0 .../bytes/responsebody/operations/__init__.py | 25 + .../responsebody}/operations/_operations.py | 210 +- .../bytes/responsebody}/operations/_patch.py | 0 .../azure/generated/encode-bytes/setup.py | 7 +- .../generated/encode-datetime/MANIFEST.in | 2 +- .../azure/generated/encode-datetime/README.md | 4 +- .../encode/datetime/_client.py | 5 +- .../encode/datetime/aio/_client.py | 5 +- .../datetime/aio/operations/__init__.py | 31 - .../encode/datetime/header/__init__.py | 1 + .../encode/datetime/header/aio/__init__.py | 1 + .../header/aio/operations/__init__.py | 25 + .../header/aio/operations/_operations.py | 293 ++ .../datetime/header/aio/operations}/_patch.py | 0 .../datetime/header/operations/__init__.py | 25 + .../datetime/header/operations/_operations.py | 362 ++ .../datetime/header}/operations/_patch.py | 0 .../encode/datetime/operations/__init__.py | 31 - .../encode/datetime/operations/_operations.py | 1630 ------- .../encode/datetime/property/__init__.py | 1 + .../encode/datetime/property/aio/__init__.py | 1 + .../property}/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 740 +--- .../property/aio/operations}/_patch.py | 0 .../datetime/property}/operations/__init__.py | 0 .../property/operations/_operations.py | 746 ++++ .../datetime/property/operations/_patch.py | 20 + .../encode/datetime/query/__init__.py | 1 + .../encode/datetime/query/aio/__init__.py | 1 + .../datetime/query/aio/operations/__init__.py | 25 + .../query/aio/operations/_operations.py | 293 ++ .../datetime/query/aio/operations/_patch.py | 20 + .../datetime/query/operations/__init__.py | 25 + .../datetime/query/operations/_operations.py | 360 ++ .../datetime/query/operations/_patch.py | 20 + .../datetime/responseheader/__init__.py | 1 + .../datetime/responseheader/aio/__init__.py | 1 + .../responseheader/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 244 + .../responseheader/aio/operations/_patch.py | 20 + .../responseheader/operations/__init__.py | 25 + .../responseheader/operations/_operations.py | 269 ++ .../responseheader/operations/_patch.py | 20 + .../azure/generated/encode-datetime/setup.py | 7 +- .../generated/encode-duration/MANIFEST.in | 2 +- .../azure/generated/encode-duration/README.md | 4 +- .../encode-duration/apiview-properties.json | 12 +- .../encode/duration/_client.py | 4 +- .../encode/duration/aio/_client.py | 4 +- .../encode/duration/header/__init__.py | 1 + .../encode/duration/header/aio/__init__.py | 1 + .../header/aio/operations/__init__.py | 25 + .../header/aio/operations/_operations.py | 341 ++ .../duration/header/aio/operations/_patch.py | 20 + .../duration/header/operations/__init__.py | 25 + .../duration/header/operations/_operations.py | 419 ++ .../duration/header/operations/_patch.py | 20 + .../encode/duration/property/__init__.py | 1 + .../encode/duration/property/aio/__init__.py | 1 + .../{ => property/aio}/operations/__init__.py | 4 - .../aio/operations/_operations.py | 624 +-- .../property/aio/operations/_patch.py | 20 + .../{ => property}/models/__init__.py | 0 .../duration/{ => property}/models/_models.py | 4 +- .../encode/duration/property/models/_patch.py | 20 + .../{aio => property}/operations/__init__.py | 4 - .../{ => property}/operations/_operations.py | 806 +--- .../duration/property/operations/_patch.py | 20 + .../encode/duration/query/__init__.py | 1 + .../encode/duration/query/aio/__init__.py | 1 + .../duration/query/aio/operations/__init__.py | 25 + .../query/aio/operations/_operations.py | 341 ++ .../duration/query/aio/operations/_patch.py | 20 + .../duration/query/operations/__init__.py | 25 + .../duration/query/operations/_operations.py | 415 ++ .../duration/query/operations/_patch.py | 20 + .../azure/generated/encode-duration/setup.py | 7 +- .../generated/encode-numeric/MANIFEST.in | 2 +- .../azure/generated/encode-numeric/README.md | 4 +- .../encode-numeric/apiview-properties.json | 6 +- .../encode-numeric/encode/numeric/_client.py | 2 +- .../encode/numeric/aio/_client.py | 2 +- .../encode/numeric/property/__init__.py | 1 + .../encode/numeric/property/aio/__init__.py | 1 + .../property/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 6 +- .../numeric/property/aio/operations/_patch.py | 20 + .../numeric/{ => property}/models/__init__.py | 0 .../numeric/{ => property}/models/_models.py | 4 +- .../encode/numeric/property/models/_patch.py | 20 + .../numeric/property/operations/__init__.py | 25 + .../{ => property}/operations/_operations.py | 6 +- .../numeric/property/operations/_patch.py | 20 + .../azure/generated/encode-numeric/setup.py | 7 +- .../generated/headasbooleanfalse/MANIFEST.in | 2 +- .../generated/headasbooleanfalse/README.md | 4 +- .../generated/headasbooleanfalse/setup.py | 7 +- .../generated/headasbooleantrue/MANIFEST.in | 2 +- .../generated/headasbooleantrue/README.md | 4 +- .../generated/headasbooleantrue/setup.py | 7 +- .../generated/parameters-basic/MANIFEST.in | 2 +- .../generated/parameters-basic/README.md | 4 +- .../parameters-basic/apiview-properties.json | 2 +- .../parameters/basic/_client.py | 3 +- .../parameters/basic/aio/_client.py | 3 +- .../parameters/basic/explicitbody/__init__.py | 1 + .../basic/explicitbody/aio/__init__.py | 1 + .../aio}/operations/__init__.py | 2 - .../aio/operations/_operations.py | 155 + .../explicitbody/aio/operations/_patch.py | 20 + .../{ => explicitbody}/models/__init__.py | 0 .../{ => explicitbody}/models/_models.py | 4 +- .../basic/explicitbody/models/_patch.py | 20 + .../operations/__init__.py | 2 - .../explicitbody/operations/_operations.py | 173 + .../basic/explicitbody/operations/_patch.py | 20 + .../parameters/basic/implicitbody/__init__.py | 1 + .../basic/implicitbody/aio/__init__.py | 1 + .../implicitbody/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 162 + .../implicitbody/aio/operations/_patch.py | 20 + .../basic/implicitbody/operations/__init__.py | 25 + .../implicitbody/operations/_operations.py | 180 + .../basic/implicitbody/operations/_patch.py | 20 + .../azure/generated/parameters-basic/setup.py | 7 +- .../parameters-body-optionality/MANIFEST.in | 2 +- .../parameters-body-optionality/README.md | 4 +- .../parameters/bodyoptionality/_client.py | 3 +- .../operations => _operations}/__init__.py | 2 - .../_operations/_operations.py | 281 ++ .../bodyoptionality/_operations/_patch.py | 20 + .../parameters/bodyoptionality/aio/_client.py | 3 +- .../_operations}/__init__.py | 2 - .../aio/_operations/_operations.py | 256 ++ .../bodyoptionality/aio/_operations/_patch.py | 20 + .../optionalexplicit/__init__.py | 1 + .../optionalexplicit/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 267 ++ .../optionalexplicit/aio/operations/_patch.py | 20 + .../optionalexplicit/operations/__init__.py | 25 + .../operations/_operations.py | 297 ++ .../optionalexplicit/operations/_patch.py | 20 + .../parameters-body-optionality/setup.py | 7 +- .../parameters-collection-format/MANIFEST.in | 2 +- .../parameters-collection-format/README.md | 4 +- .../parameters/collectionformat/_client.py | 3 +- .../collectionformat/aio/_client.py | 3 +- .../collectionformat/header/__init__.py | 1 + .../collectionformat/header/aio/__init__.py | 1 + .../header/aio/operations/__init__.py | 25 + .../header/aio/operations/_operations.py | 98 + .../header/aio/operations/_patch.py | 20 + .../header/operations/__init__.py | 25 + .../header/operations/_operations.py | 113 + .../header/operations/_patch.py | 20 + .../collectionformat/query/__init__.py | 1 + .../collectionformat/query/aio/__init__.py | 1 + .../query/aio/operations/__init__.py | 25 + .../{ => query}/aio/operations/_operations.py | 70 +- .../query/aio/operations/_patch.py | 20 + .../query/operations/__init__.py | 25 + .../{ => query}/operations/_operations.py | 87 +- .../query/operations/_patch.py | 20 + .../parameters-collection-format/setup.py | 7 +- .../generated/parameters-spread/MANIFEST.in | 2 +- .../generated/parameters-spread/README.md | 4 +- .../parameters-spread/apiview-properties.json | 2 +- .../parameters/spread/_client.py | 3 +- .../parameters/spread/aio/_client.py | 3 +- .../parameters/spread/alias/__init__.py | 1 + .../parameters/spread/alias/aio/__init__.py | 1 + .../{ => alias}/aio/operations/__init__.py | 2 - .../{ => alias}/aio/operations/_operations.py | 559 +-- .../spread/alias/aio/operations/_patch.py | 20 + .../spread/{ => alias}/operations/__init__.py | 2 - .../{ => alias}/operations/_operations.py | 657 +-- .../spread/alias/operations/_patch.py | 20 + .../parameters/spread/model/__init__.py | 1 + .../parameters/spread/model/aio/__init__.py | 1 + .../spread/model/aio/operations/__init__.py | 25 + .../model}/aio/operations/_operations.py | 291 +- .../spread/model/aio/operations/_patch.py | 20 + .../spread/{ => model}/models/__init__.py | 0 .../spread/{ => model}/models/_models.py | 4 +- .../parameters/spread/model/models/_patch.py | 20 + .../spread/model/operations/__init__.py | 25 + .../spread/model}/operations/_operations.py | 336 +- .../spread/model/operations/_patch.py | 20 + .../generated/parameters-spread/setup.py | 7 +- .../payload-content-negotiation/MANIFEST.in | 2 +- .../payload-content-negotiation/README.md | 4 +- .../apiview-properties.json | 2 +- .../payload/contentnegotiation/_client.py | 3 +- .../payload/contentnegotiation/aio/_client.py | 3 +- .../differentbody/__init__.py | 1 + .../differentbody/aio/__init__.py | 1 + .../aio/operations/__init__.py | 2 - .../aio/operations/_operations.py | 178 + .../differentbody/aio/operations/_patch.py | 20 + .../{ => differentbody}/models/__init__.py | 0 .../{ => differentbody}/models/_models.py | 4 +- .../differentbody/models/_patch.py | 20 + .../operations/__init__.py | 2 - .../differentbody/operations/_operations.py | 203 + .../differentbody/operations/_patch.py | 20 + .../contentnegotiation/samebody/__init__.py | 1 + .../samebody/aio/__init__.py | 1 + .../samebody/aio/operations/__init__.py | 25 + .../samebody/aio/operations/_operations.py | 173 + .../samebody/aio/operations/_patch.py | 20 + .../samebody/operations/__init__.py | 25 + .../samebody/operations/_operations.py | 198 + .../samebody/operations/_patch.py | 20 + .../payload-content-negotiation/setup.py | 7 +- .../payload-json-merge-patch/MANIFEST.in | 2 +- .../payload-json-merge-patch/README.md | 4 +- .../payload-json-merge-patch/setup.py | 7 +- .../generated/payload-media-type/MANIFEST.in | 2 +- .../generated/payload-media-type/README.md | 4 +- .../payload/mediatype/_client.py | 2 +- .../payload/mediatype/aio/_client.py | 2 +- .../payload/mediatype/stringbody/__init__.py | 1 + .../mediatype/stringbody/aio/__init__.py | 1 + .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 6 +- .../stringbody/aio/operations/_patch.py | 20 + .../{ => stringbody}/operations/__init__.py | 0 .../operations/_operations.py | 6 +- .../mediatype/stringbody/operations/_patch.py | 20 + .../generated/payload-media-type/setup.py | 7 +- .../generated/payload-multipart/MANIFEST.in | 2 +- .../generated/payload-multipart/README.md | 4 +- .../payload-multipart/apiview-properties.json | 2 +- .../payload/multipart/_client.py | 2 +- .../payload/multipart/aio/_client.py | 2 +- .../payload/multipart/formdata/__init__.py | 1 + .../multipart/formdata/aio/__init__.py | 1 + .../{ => formdata}/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 468 +- .../formdata/aio/operations/_patch.py | 20 + .../multipart/formdata/httpparts/__init__.py | 1 + .../formdata/httpparts/aio/__init__.py | 1 + .../httpparts/aio/operations/__init__.py | 22 + .../httpparts/aio/operations/_operations.py | 140 + .../httpparts/aio/operations/_patch.py | 20 + .../httpparts/contenttype/__init__.py | 1 + .../httpparts/contenttype/aio/__init__.py | 1 + .../contenttype/aio/operations/__init__.py | 22 + .../contenttype/aio/operations/_operations.py | 298 ++ .../contenttype/aio/operations/_patch.py | 20 + .../contenttype/operations/__init__.py | 22 + .../contenttype/operations/_operations.py | 324 ++ .../contenttype/operations/_patch.py | 20 + .../formdata/httpparts/nonstring/__init__.py | 1 + .../httpparts/nonstring/aio/__init__.py | 1 + .../nonstring/aio/operations/__init__.py | 22 + .../nonstring/aio/operations/_operations.py | 130 + .../nonstring/aio/operations/_patch.py | 20 + .../httpparts/nonstring/models/__init__.py | 27 + .../httpparts/nonstring/models/_models.py | 41 + .../httpparts/nonstring/models/_patch.py | 20 + .../nonstring/operations/__init__.py | 22 + .../nonstring/operations/_operations.py | 144 + .../httpparts/nonstring/operations/_patch.py | 20 + .../formdata/httpparts/operations/__init__.py | 22 + .../httpparts/operations/_operations.py | 154 + .../formdata/httpparts/operations/_patch.py | 20 + .../{ => formdata}/operations/__init__.py | 0 .../{ => formdata}/operations/_operations.py | 512 +-- .../multipart/formdata/operations/_patch.py | 20 + .../payload/multipart/models/__init__.py | 2 - .../payload/multipart/models/_models.py | 28 - .../generated/payload-multipart/setup.py | 7 +- .../generated/payload-pageable/MANIFEST.in | 2 +- .../generated/payload-pageable/README.md | 4 +- .../payload/pageable/_client.py | 2 +- .../payload/pageable/aio/_client.py | 2 +- .../serverdrivenpagination/__init__.py | 1 + .../serverdrivenpagination/aio/__init__.py | 1 + .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 129 + .../aio/operations/_patch.py | 20 + .../continuationtoken/__init__.py | 1 + .../continuationtoken/aio/__init__.py | 1 + .../aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 101 +- .../aio/operations/_patch.py | 20 + .../continuationtoken/operations/__init__.py | 22 + .../operations/_operations.py | 114 +- .../continuationtoken/operations/_patch.py | 20 + .../operations/__init__.py | 0 .../operations/_operations.py | 146 + .../operations/_patch.py | 20 + .../azure/generated/payload-pageable/setup.py | 7 +- .../azure/generated/payload-xml/MANIFEST.in | 2 +- .../azure/generated/payload-xml/README.md | 4 +- .../test/azure/generated/payload-xml/setup.py | 7 +- .../resiliency-srv-driven1/MANIFEST.in | 2 +- .../resiliency-srv-driven1/README.md | 4 +- .../generated/resiliency-srv-driven1/setup.py | 7 +- .../resiliency-srv-driven2/MANIFEST.in | 2 +- .../resiliency-srv-driven2/README.md | 4 +- .../generated/resiliency-srv-driven2/setup.py | 7 +- .../response-status-code-range/MANIFEST.in | 2 +- .../response-status-code-range/README.md | 4 +- .../response-status-code-range/setup.py | 7 +- .../test/azure/generated/routes/MANIFEST.in | 2 +- .../test/azure/generated/routes/README.md | 4 +- .../azure/generated/routes/routes/_client.py | 9 +- .../generated/routes/routes/aio/_client.py | 9 +- .../routes/routes/aio/operations/__init__.py | 4 - .../routes/aio/operations/_operations.py | 2578 +---------- .../routes/routes/operations/__init__.py | 4 - .../routes/routes/operations/_operations.py | 3161 +------------ .../routes/routes/pathparameters/__init__.py | 1 + .../routes/pathparameters/aio/__init__.py | 1 + .../pathparameters/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 217 + .../pathparameters/aio/operations/_patch.py | 20 + .../pathparameters/labelexpansion/__init__.py | 1 + .../labelexpansion/aio/__init__.py | 1 + .../labelexpansion/aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../labelexpansion/aio/operations/_patch.py | 20 + .../labelexpansion/explode/__init__.py | 1 + .../labelexpansion/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 236 + .../explode/operations/_patch.py | 20 + .../labelexpansion/operations/__init__.py | 22 + .../labelexpansion/operations/_operations.py | 38 + .../labelexpansion/operations/_patch.py | 20 + .../labelexpansion/standard/__init__.py | 1 + .../labelexpansion/standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 236 + .../standard/operations/_patch.py | 20 + .../matrixexpansion/__init__.py | 1 + .../matrixexpansion/aio/__init__.py | 1 + .../aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../matrixexpansion/aio/operations/_patch.py | 20 + .../matrixexpansion/explode/__init__.py | 1 + .../matrixexpansion/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 236 + .../explode/operations/_patch.py | 20 + .../matrixexpansion/operations/__init__.py | 22 + .../matrixexpansion/operations/_operations.py | 38 + .../matrixexpansion/operations/_patch.py | 20 + .../matrixexpansion/standard/__init__.py | 1 + .../matrixexpansion/standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 236 + .../standard/operations/_patch.py | 20 + .../pathparameters/operations/__init__.py | 25 + .../pathparameters/operations/_operations.py | 255 ++ .../pathparameters/operations/_patch.py | 20 + .../pathparameters/pathexpansion/__init__.py | 1 + .../pathexpansion/aio/__init__.py | 1 + .../pathexpansion/aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../pathexpansion/aio/operations/_patch.py | 20 + .../pathexpansion/explode/__init__.py | 1 + .../pathexpansion/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 236 + .../explode/operations/_patch.py | 20 + .../pathexpansion/operations/__init__.py | 22 + .../pathexpansion/operations/_operations.py | 38 + .../pathexpansion/operations/_patch.py | 20 + .../pathexpansion/standard/__init__.py | 1 + .../pathexpansion/standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 236 + .../standard/operations/_patch.py | 20 + .../reservedexpansion/__init__.py | 1 + .../reservedexpansion/aio/__init__.py | 1 + .../aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 148 + .../aio/operations/_patch.py | 20 + .../reservedexpansion/operations/__init__.py | 22 + .../operations/_operations.py | 175 + .../reservedexpansion/operations/_patch.py | 20 + .../simpleexpansion/__init__.py | 1 + .../simpleexpansion/aio/__init__.py | 1 + .../aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../simpleexpansion/aio/operations/_patch.py | 20 + .../simpleexpansion/explode/__init__.py | 1 + .../simpleexpansion/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 236 + .../explode/operations/_patch.py | 20 + .../simpleexpansion/operations/__init__.py | 22 + .../simpleexpansion/operations/_operations.py | 38 + .../simpleexpansion/operations/_patch.py | 20 + .../simpleexpansion/standard/__init__.py | 1 + .../simpleexpansion/standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 236 + .../standard/operations/_patch.py | 20 + .../routes/routes/queryparameters/__init__.py | 1 + .../routes/queryparameters/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 205 + .../queryparameters/aio/operations/_patch.py | 20 + .../queryparameters/operations/__init__.py | 25 + .../queryparameters/operations/_operations.py | 244 + .../queryparameters/operations/_patch.py | 20 + .../querycontinuation/__init__.py | 1 + .../querycontinuation/aio/__init__.py | 1 + .../aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../aio/operations/_patch.py | 20 + .../querycontinuation/explode/__init__.py | 1 + .../querycontinuation/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 237 + .../explode/operations/_patch.py | 20 + .../querycontinuation/operations/__init__.py | 22 + .../operations/_operations.py | 38 + .../querycontinuation/operations/_patch.py | 20 + .../querycontinuation/standard/__init__.py | 1 + .../standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 237 + .../standard/operations/_patch.py | 20 + .../queryexpansion/__init__.py | 1 + .../queryexpansion/aio/__init__.py | 1 + .../queryexpansion/aio/operations/__init__.py | 22 + .../aio/operations/_operations.py | 38 + .../queryexpansion/aio/operations/_patch.py | 20 + .../queryexpansion/explode/__init__.py | 1 + .../queryexpansion/explode/aio/__init__.py | 1 + .../explode/aio/operations/__init__.py | 22 + .../explode/aio/operations/_operations.py | 196 + .../explode/aio/operations/_patch.py | 20 + .../explode/operations/__init__.py | 22 + .../explode/operations/_operations.py | 237 + .../explode/operations/_patch.py | 20 + .../queryexpansion/operations/__init__.py | 22 + .../queryexpansion/operations/_operations.py | 38 + .../queryexpansion/operations/_patch.py | 20 + .../queryexpansion/standard/__init__.py | 1 + .../queryexpansion/standard/aio/__init__.py | 1 + .../standard/aio/operations/__init__.py | 22 + .../standard/aio/operations/_operations.py | 196 + .../standard/aio/operations/_patch.py | 20 + .../standard/operations/__init__.py | 22 + .../standard/operations/_operations.py | 237 + .../standard/operations/_patch.py | 20 + .../test/azure/generated/routes/setup.py | 7 +- .../MANIFEST.in | 2 +- .../serialization-encoded-name-json/README.md | 4 +- .../apiview-properties.json | 2 +- .../serialization/encodedname/json/_client.py | 2 +- .../encodedname/json/aio/_client.py | 2 +- .../encodedname/json/property/__init__.py | 1 + .../encodedname/json/property/aio/__init__.py | 1 + .../json/property/aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 6 +- .../json/property/aio/operations/_patch.py | 20 + .../json/{ => property}/models/__init__.py | 0 .../json/{ => property}/models/_models.py | 4 +- .../json/property/models/_patch.py | 20 + .../json/property/operations/__init__.py | 25 + .../{ => property}/operations/_operations.py | 6 +- .../json/property/operations/_patch.py | 20 + .../serialization-encoded-name-json/setup.py | 7 +- .../server-endpoint-not-defined/MANIFEST.in | 2 +- .../server-endpoint-not-defined/README.md | 4 +- .../server-endpoint-not-defined/setup.py | 7 +- .../server-path-multiple/MANIFEST.in | 2 +- .../generated/server-path-multiple/README.md | 4 +- .../generated/server-path-multiple/setup.py | 7 +- .../generated/server-path-single/MANIFEST.in | 2 +- .../generated/server-path-single/README.md | 4 +- .../generated/server-path-single/setup.py | 7 +- .../server-versions-not-versioned/MANIFEST.in | 2 +- .../server-versions-not-versioned/README.md | 4 +- .../server-versions-not-versioned/setup.py | 7 +- .../server-versions-versioned/MANIFEST.in | 2 +- .../server-versions-versioned/README.md | 4 +- .../server-versions-versioned/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../special-headers-repeatability/MANIFEST.in | 2 +- .../special-headers-repeatability/README.md | 4 +- .../special-headers-repeatability/setup.py | 7 +- .../azure/generated/special-words/MANIFEST.in | 2 +- .../azure/generated/special-words/README.md | 4 +- .../special-words/apiview-properties.json | 68 +- .../azure/generated/special-words/setup.py | 7 +- .../special-words/specialwords/_client.py | 4 +- .../special-words/specialwords/aio/_client.py | 4 +- .../specialwords/aio/operations/__init__.py | 4 - .../aio/operations/_operations.py | 3456 +-------------- .../specialwords/modelproperties/__init__.py | 1 + .../modelproperties/aio/__init__.py | 1 + .../aio/operations/__init__.py | 25 + .../aio/operations/_operations.py | 157 + .../modelproperties/aio/operations/_patch.py | 20 + .../modelproperties/models/__init__.py | 27 + .../modelproperties/models/_models.py | 41 + .../modelproperties/models/_patch.py | 20 + .../modelproperties/operations/__init__.py | 25 + .../modelproperties/operations/_operations.py | 175 + .../modelproperties/operations/_patch.py | 20 + .../specialwords/models/__init__.py | 94 +- .../specialwords/models/aio/__init__.py | 1 + .../models/aio/operations/__init__.py | 25 + .../models/aio/operations/_operations.py | 3370 ++++++++++++++ .../models/aio/operations/_patch.py | 20 + .../specialwords/models/models/__init__.py | 91 + .../models/{ => models}/_models.py | 32 +- .../specialwords/models/models/_patch.py | 20 + .../models/operations/__init__.py | 25 + .../models/operations/_operations.py | 3828 ++++++++++++++++ .../specialwords/models/operations/_patch.py | 20 + .../specialwords/operations/__init__.py | 4 - .../specialwords/operations/_operations.py | 3927 +---------------- .../generated/typetest-array/MANIFEST.in | 2 +- .../azure/generated/typetest-array/README.md | 4 +- .../azure/generated/typetest-array/setup.py | 7 +- .../generated/typetest-dictionary/MANIFEST.in | 2 +- .../generated/typetest-dictionary/README.md | 4 +- .../generated/typetest-dictionary/setup.py | 7 +- .../typetest-enum-extensible/MANIFEST.in | 2 +- .../typetest-enum-extensible/README.md | 4 +- .../typetest-enum-extensible/setup.py | 7 +- .../generated/typetest-enum-fixed/MANIFEST.in | 2 +- .../generated/typetest-enum-fixed/README.md | 4 +- .../generated/typetest-enum-fixed/setup.py | 7 +- .../typetest-model-empty/MANIFEST.in | 2 +- .../generated/typetest-model-empty/README.md | 4 +- .../generated/typetest-model-empty/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../typetest-model-enumdiscriminator/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../typetest-model-notdiscriminated/README.md | 4 +- .../typetest-model-notdiscriminated/setup.py | 7 +- .../typetest-model-recursive/MANIFEST.in | 2 +- .../typetest-model-recursive/README.md | 4 +- .../typetest-model-recursive/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../typetest-model-usage/MANIFEST.in | 2 +- .../generated/typetest-model-usage/README.md | 4 +- .../generated/typetest-model-usage/setup.py | 7 +- .../typetest-model-visibility/MANIFEST.in | 2 +- .../typetest-model-visibility/README.md | 4 +- .../typetest-model-visibility/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../setup.py | 7 +- .../typetest-property-nullable/MANIFEST.in | 2 +- .../typetest-property-nullable/README.md | 4 +- .../typetest-property-nullable/setup.py | 7 +- .../typetest-property-optional/MANIFEST.in | 2 +- .../typetest-property-optional/README.md | 4 +- .../typetest-property-optional/setup.py | 7 +- .../typetest-property-valuetypes/MANIFEST.in | 2 +- .../typetest-property-valuetypes/README.md | 4 +- .../typetest-property-valuetypes/setup.py | 7 +- .../generated/typetest-scalar/MANIFEST.in | 2 +- .../azure/generated/typetest-scalar/README.md | 4 +- .../azure/generated/typetest-scalar/setup.py | 7 +- .../generated/typetest-union/MANIFEST.in | 2 +- .../azure/generated/typetest-union/README.md | 4 +- .../azure/generated/typetest-union/setup.py | 7 +- .../union/aio/operations/_operations.py | 100 +- .../typetest/union/models/_models.py | 108 +- .../typetest/union/operations/_operations.py | 100 +- .../generated/versioning-added/MANIFEST.in | 2 +- .../generated/versioning-added/README.md | 4 +- .../azure/generated/versioning-added/setup.py | 7 +- .../versioning-madeoptional/MANIFEST.in | 2 +- .../versioning-madeoptional/README.md | 4 +- .../versioning-madeoptional/setup.py | 7 +- .../generated/versioning-removed/MANIFEST.in | 2 +- .../generated/versioning-removed/README.md | 4 +- .../generated/versioning-removed/setup.py | 7 +- .../versioning-renamedfrom/MANIFEST.in | 2 +- .../versioning-renamedfrom/README.md | 4 +- .../generated/versioning-renamedfrom/setup.py | 7 +- .../MANIFEST.in | 2 +- .../README.md | 4 +- .../versioning-returntypechangedfrom/setup.py | 7 +- .../versioning-typechangedfrom/MANIFEST.in | 2 +- .../versioning-typechangedfrom/README.md | 4 +- .../versioning-typechangedfrom/setup.py | 7 +- .../authentication-api-key/MANIFEST.in | 2 +- .../generated/authentication-api-key/setup.py | 7 +- .../authentication-http-custom/MANIFEST.in | 2 +- .../authentication-http-custom/setup.py | 9 +- .../authentication-oauth2/MANIFEST.in | 2 +- .../generated/authentication-oauth2/setup.py | 7 +- .../authentication-union/MANIFEST.in | 2 +- .../generated/authentication-union/setup.py | 7 +- .../generated/encode-bytes/MANIFEST.in | 2 +- .../property/aio/operations/_operations.py | 66 +- .../bytes/property/operations/_operations.py | 66 +- .../unbranded/generated/encode-bytes/setup.py | 7 +- .../generated/encode-datetime/MANIFEST.in | 2 +- .../property/aio/operations/_operations.py | 86 +- .../property/operations/_operations.py | 86 +- .../generated/encode-datetime/setup.py | 7 +- .../generated/encode-duration/MANIFEST.in | 2 +- .../property/aio/operations/_operations.py | 98 +- .../property/operations/_operations.py | 98 +- .../generated/encode-duration/setup.py | 7 +- .../generated/encode-numeric/MANIFEST.in | 2 +- .../property/aio/operations/_operations.py | 50 +- .../property/operations/_operations.py | 50 +- .../generated/encode-numeric/setup.py | 7 +- .../generated/headasbooleanfalse/MANIFEST.in | 2 +- .../generated/headasbooleanfalse/setup.py | 7 +- .../generated/headasbooleantrue/MANIFEST.in | 2 +- .../generated/headasbooleantrue/setup.py | 7 +- .../generated/parameters-basic/MANIFEST.in | 2 +- .../aio/operations/_operations.py | 6 +- .../explicitbody/operations/_operations.py | 6 +- .../generated/parameters-basic/setup.py | 7 +- .../parameters-body-optionality/MANIFEST.in | 2 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../parameters-body-optionality/setup.py | 7 +- .../parameters-collection-format/MANIFEST.in | 2 +- .../query/operations/_operations.py | 6 +- .../parameters-collection-format/setup.py | 7 +- .../generated/parameters-spread/MANIFEST.in | 2 +- .../model/aio/operations/_operations.py | 10 +- .../spread/model/operations/_operations.py | 10 +- .../generated/parameters-spread/setup.py | 7 +- .../payload-content-negotiation/MANIFEST.in | 2 +- .../aio/operations/_operations.py | 8 +- .../differentbody/operations/_operations.py | 8 +- .../payload-content-negotiation/setup.py | 7 +- .../payload-json-merge-patch/MANIFEST.in | 2 +- .../payload-json-merge-patch/setup.py | 7 +- .../generated/payload-media-type/MANIFEST.in | 2 +- .../generated/payload-media-type/setup.py | 7 +- .../generated/payload-multipart/MANIFEST.in | 2 +- .../formdata/aio/operations/_operations.py | 26 +- .../httpparts/aio/operations/_operations.py | 6 +- .../contenttype/aio/operations/_operations.py | 14 +- .../contenttype/operations/_operations.py | 14 +- .../nonstring/aio/operations/_operations.py | 6 +- .../nonstring/operations/_operations.py | 6 +- .../httpparts/operations/_operations.py | 6 +- .../formdata/operations/_operations.py | 26 +- .../generated/payload-multipart/setup.py | 7 +- .../generated/payload-pageable/MANIFEST.in | 2 +- .../aio/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 26 +- .../operations/_operations.py | 26 +- .../operations/_operations.py | 8 +- .../generated/payload-pageable/setup.py | 7 +- .../generated/payload-xml/MANIFEST.in | 2 +- .../unbranded/generated/payload-xml/setup.py | 7 +- .../response-status-code-range/MANIFEST.in | 2 +- .../response-status-code-range/setup.py | 7 +- .../unbranded/generated/routes/MANIFEST.in | 2 +- .../test/unbranded/generated/routes/setup.py | 7 +- .../MANIFEST.in | 2 +- .../property/aio/operations/_operations.py | 12 +- .../json/property/operations/_operations.py | 12 +- .../serialization-encoded-name-json/setup.py | 7 +- .../server-endpoint-not-defined/MANIFEST.in | 2 +- .../server-endpoint-not-defined/setup.py | 7 +- .../server-path-multiple/MANIFEST.in | 2 +- .../generated/server-path-multiple/setup.py | 7 +- .../generated/server-path-single/MANIFEST.in | 2 +- .../generated/server-path-single/setup.py | 7 +- .../server-versions-not-versioned/MANIFEST.in | 2 +- .../server-versions-not-versioned/setup.py | 7 +- .../server-versions-versioned/MANIFEST.in | 2 +- .../server-versions-versioned/setup.py | 7 +- .../MANIFEST.in | 2 +- .../setup.py | 7 +- .../special-headers-repeatability/MANIFEST.in | 2 +- .../special-headers-repeatability/setup.py | 7 +- .../generated/special-words/MANIFEST.in | 2 +- .../generated/special-words/setup.py | 7 +- .../aio/operations/_operations.py | 6 +- .../modelproperties/operations/_operations.py | 6 +- .../models/aio/operations/_operations.py | 134 +- .../models/operations/_operations.py | 134 +- .../generated/typetest-array/MANIFEST.in | 2 +- .../generated/typetest-array/setup.py | 7 +- .../generated/typetest-dictionary/MANIFEST.in | 2 +- .../generated/typetest-dictionary/setup.py | 7 +- .../typetest-enum-extensible/MANIFEST.in | 2 +- .../typetest-enum-extensible/setup.py | 7 +- .../generated/typetest-enum-fixed/MANIFEST.in | 2 +- .../generated/typetest-enum-fixed/setup.py | 7 +- .../typetest-model-empty/MANIFEST.in | 2 +- .../generated/typetest-model-empty/setup.py | 7 +- .../MANIFEST.in | 2 +- .../typetest-model-enumdiscriminator/setup.py | 7 +- .../MANIFEST.in | 2 +- .../setup.py | 7 +- .../MANIFEST.in | 2 +- .../typetest-model-notdiscriminated/setup.py | 7 +- .../typetest-model-recursive/MANIFEST.in | 2 +- .../typetest-model-recursive/setup.py | 7 +- .../MANIFEST.in | 2 +- .../setup.py | 7 +- .../typetest-model-usage/MANIFEST.in | 2 +- .../generated/typetest-model-usage/setup.py | 7 +- .../typetest-model-visibility/MANIFEST.in | 2 +- .../typetest-model-visibility/setup.py | 7 +- .../MANIFEST.in | 2 +- .../setup.py | 7 +- .../typetest-property-nullable/MANIFEST.in | 2 +- .../typetest-property-nullable/setup.py | 7 +- .../typetest-property-optional/MANIFEST.in | 2 +- .../typetest-property-optional/setup.py | 7 +- .../typetest-property-valuetypes/MANIFEST.in | 2 +- .../typetest-property-valuetypes/setup.py | 7 +- .../generated/typetest-scalar/MANIFEST.in | 2 +- .../generated/typetest-scalar/setup.py | 7 +- .../generated/typetest-union/MANIFEST.in | 2 +- .../generated/typetest-union/setup.py | 7 +- .../union/aio/operations/_operations.py | 100 +- .../typetest/union/models/_models.py | 108 +- .../typetest/union/operations/_operations.py | 100 +- .../generated/versioning-added/MANIFEST.in | 2 +- .../generated/versioning-added/setup.py | 7 +- .../versioning-madeoptional/MANIFEST.in | 2 +- .../versioning-madeoptional/setup.py | 7 +- .../generated/versioning-removed/MANIFEST.in | 2 +- .../generated/versioning-removed/setup.py | 7 +- .../versioning-renamedfrom/MANIFEST.in | 2 +- .../generated/versioning-renamedfrom/setup.py | 7 +- .../MANIFEST.in | 2 +- .../versioning-returntypechangedfrom/setup.py | 7 +- .../versioning-typechangedfrom/MANIFEST.in | 2 +- .../versioning-typechangedfrom/setup.py | 7 +- 1062 files changed, 36408 insertions(+), 28821 deletions(-) delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{ => internaloperation}/aio/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{ => internaloperation}/models/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{ => internaloperation}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation}/aio/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{ => publicoperation}/models/__init__.py (90%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/{azure-example-basic/specs/azure/example/basic/_operations => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{azure-example-basic/specs/azure/example/basic => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{ => relativemodelinoperation}/models/_models.py (52%) rename packages/typespec-python/test/azure/generated/{azure-example-basic/specs/azure/example/basic/aio/_operations => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/{azure-example-basic/specs/azure/example/basic/aio => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{client-naming/client/naming => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation}/aio/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py rename packages/typespec-python/test/azure/generated/{client-naming/client/naming => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation}/models/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/{client-naming/client/naming => azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{ => modelinoperation}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{ => modelinoperation}/aio/operations/_operations.py (98%) rename packages/typespec-python/test/azure/generated/{encode-bytes/encode/bytes => azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation}/aio/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py rename packages/typespec-python/test/azure/generated/{encode-bytes/encode/bytes/operations => azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{ => modelinoperation}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{ => modelinoperation}/operations/_operations.py (99%) rename packages/typespec-python/test/azure/generated/{encode-datetime/encode/datetime/aio => azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_client.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_model_base.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_operations/_operations.py (94%) rename packages/typespec-python/test/azure/generated/{encode-datetime/encode/datetime/operations => azure-example-basic/azureexamplebasicclient/_operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/aio/operations => azure-example-basic/azureexamplebasicclient}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_serialization.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/_version.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/_client.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/_operations/_operations.py (93%) rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/models => azure-example-basic/azureexamplebasicclient/aio/_operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/operations => azure-example-basic/azureexamplebasicclient/aio}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/aio/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{specs/azure/example/basic => azureexamplebasicclient}/py.typed (100%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{operations => _operations}/__init__.py (84%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{operations => _operations}/_operations.py (59%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric/aio/operations => client-naming/client/naming/_operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/{operations => _operations}/__init__.py (84%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/{operations => _operations}/_operations.py (59%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric/models => client-naming/client/naming/aio/_operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/{parameters-basic/parameters/basic => client-naming/client/naming/model}/aio/operations/_operations.py (72%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric => client-naming/client/naming/model/aio}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py rename packages/typespec-python/test/azure/generated/{parameters-basic/parameters/basic/aio/operations => client-naming/client/naming/model/models}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py rename packages/typespec-python/test/azure/generated/{parameters-basic/parameters/basic => client-naming/client/naming/model}/operations/_operations.py (72%) rename packages/typespec-python/test/azure/generated/{parameters-basic/parameters/basic/models => client-naming/client/naming/model/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{ => property}/models/__init__.py (83%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{ => property}/models/_models.py (64%) rename packages/typespec-python/test/azure/generated/{parameters-basic/parameters/basic/operations => client-naming/client/naming/property/models}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-body-optionality/parameters/bodyoptionality => client-naming/client/naming/unionenum}/aio/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{ => unionenum}/models/_enums.py (100%) rename packages/typespec-python/test/azure/generated/{parameters-body-optionality/parameters/bodyoptionality/operations => client-naming/client/naming/unionenum/models}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-collection-format/parameters/collectionformat/aio => client-naming/client/naming/unionenum}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-collection-format/parameters/collectionformat => client-structure-default/client/structure/service/baz/aio}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-spread/parameters/spread/aio => client-structure-default/client/structure/service/baz}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-spread/parameters/spread/models => client-structure-default/client/structure/service/qux/aio/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py rename packages/typespec-python/test/azure/generated/{parameters-spread/parameters/spread => client-structure-default/client/structure/service/qux}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/__init__.py rename packages/typespec-python/test/azure/generated/{parameters-collection-format/parameters/collectionformat => encode-bytes/encode/bytes/header}/aio/operations/__init__.py (92%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-content-negotiation/payload/contentnegotiation => encode-bytes/encode/bytes/header}/aio/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{parameters-collection-format/parameters/collectionformat => encode-bytes/encode/bytes/header}/operations/__init__.py (92%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-content-negotiation/payload/contentnegotiation/models => encode-bytes/encode/bytes/header/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/__init__.py rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric => encode-bytes/encode/bytes/property}/aio/operations/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-content-negotiation/payload/contentnegotiation => encode-bytes/encode/bytes/property/aio}/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric => encode-bytes/encode/bytes/property}/operations/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-media-type/payload/mediatype/aio => encode-bytes/encode/bytes/property}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-media-type/payload/mediatype => encode-bytes/encode/bytes/query/aio}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-multipart/payload/multipart/aio => encode-bytes/encode/bytes/query}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-multipart/payload/multipart => encode-bytes/encode/bytes/requestbody/aio}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py rename packages/typespec-python/test/azure/generated/{payload-pageable/payload/pageable/aio => encode-bytes/encode/bytes/requestbody}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/{payload-content-negotiation/payload/contentnegotiation => encode-bytes/encode/bytes/responsebody}/aio/operations/_operations.py (67%) rename packages/typespec-python/test/azure/generated/{payload-pageable/payload/pageable => encode-bytes/encode/bytes/responsebody/aio}/operations/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/__init__.py rename packages/typespec-python/test/azure/generated/{payload-content-negotiation/payload/contentnegotiation => encode-bytes/encode/bytes/responsebody}/operations/_operations.py (64%) rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json/aio => encode-bytes/encode/bytes/responsebody}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json/models => encode-datetime/encode/datetime/header/aio/operations}/_patch.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_operations.py rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json => encode-datetime/encode/datetime/header}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/__init__.py rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json => encode-datetime/encode/datetime/property}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/{ => property}/aio/operations/_operations.py (50%) rename packages/typespec-python/test/azure/generated/{special-words/specialwords/models => encode-datetime/encode/datetime/property/aio/operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json => encode-datetime/encode/datetime/property}/operations/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{ => property/aio}/operations/__init__.py (85%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{ => property}/aio/operations/_operations.py (59%) create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{ => property}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{ => property}/models/_models.py (98%) create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{aio => property}/operations/__init__.py (85%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{ => property}/operations/_operations.py (57%) create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{ => property}/aio/operations/_operations.py (99%) create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{ => property}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{ => property}/models/_models.py (97%) create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{ => property}/operations/_operations.py (99%) create mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{ => explicitbody/aio}/operations/__init__.py (90%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{ => explicitbody}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{ => explicitbody}/models/_models.py (94%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{aio => explicitbody}/operations/__init__.py (90%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/{aio/operations => _operations}/__init__.py (90%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/{operations => aio/_operations}/__init__.py (90%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/{ => query}/aio/operations/_operations.py (80%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/__init__.py rename packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/{ => query}/operations/_operations.py (80%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => alias}/aio/operations/__init__.py (92%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => alias}/aio/operations/_operations.py (57%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => alias}/operations/__init__.py (92%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => alias}/operations/_operations.py (57%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/{parameters-body-optionality/parameters/bodyoptionality => parameters-spread/parameters/spread/model}/aio/operations/_operations.py (63%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => model}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{ => model}/models/_models.py (94%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py rename packages/typespec-python/test/azure/generated/{parameters-body-optionality/parameters/bodyoptionality => parameters-spread/parameters/spread/model}/operations/_operations.py (60%) create mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{ => differentbody}/aio/operations/__init__.py (91%) create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{ => differentbody}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{ => differentbody}/models/_models.py (94%) create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{ => differentbody}/operations/__init__.py (91%) create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/__init__.py rename packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/{ => stringbody}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/{ => stringbody}/aio/operations/_operations.py (98%) create mode 100644 packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/{ => stringbody}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/{ => stringbody}/operations/_operations.py (98%) create mode 100644 packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{ => formdata}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{ => formdata}/aio/operations/_operations.py (55%) create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{ => formdata}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{ => formdata}/operations/_operations.py (56%) create mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/__init__.py rename packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/{ => serverdrivenpagination}/aio/operations/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/{ => serverdrivenpagination/continuationtoken}/aio/operations/_operations.py (79%) create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/__init__.py rename packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/{ => serverdrivenpagination/continuationtoken}/operations/_operations.py (81%) create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/{ => serverdrivenpagination}/operations/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{ => property}/aio/operations/_operations.py (97%) create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{ => property}/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{ => property}/models/_models.py (95%) create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{ => property}/operations/_operations.py (98%) create mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py rename packages/typespec-python/test/azure/generated/special-words/specialwords/models/{ => models}/_models.py (96%) create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 677578c9139..3240e99824f 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -22,91 +22,126 @@ interface TspCommand { const EMITTER_OPTIONS: Record | Record[]> = { "resiliency/srv-driven/old.tsp": { "package-name": "resiliency-srv-driven1", + "namespace": "resiliency.srv.driven1", "package-mode": "azure-dataplane", "package-pprint-name": "ResiliencySrvDriven1", }, "resiliency/srv-driven": { "package-name": "resiliency-srv-driven2", + "namespace": "resiliency.srv.driven2", "package-mode": "azure-dataplane", "package-pprint-name": "ResiliencySrvDriven2", }, "authentication/http/custom": { "package-name": "authentication-http-custom", - "package-pprint-name": "Authentication Http Custom Service", + "namespace": "authentication.http.custom", + "package-pprint-name": "Authentication Http Custom", }, "authentication/union": { "package-name": "authentication-union", + "namespace": "authentication.union", }, "type/array": { "package-name": "typetest-array", + "namespace": "typetest.array", + "use-pyodide": "true", }, "type/dictionary": { "package-name": "typetest-dictionary", + "namespace": "typetest.dictionary", }, "type/enum/extensible": { "package-name": "typetest-enum-extensible", + "namespace": "typetest.enum.extensible", }, "type/enum/fixed": { "package-name": "typetest-enum-fixed", + "namespace": "typetest.enum.fixed", }, "type/model/empty": { "package-name": "typetest-model-empty", + "namespace": "typetest.model.empty", }, "type/model/inheritance/enum-discriminator": { "package-name": "typetest-model-enumdiscriminator", + "namespace": "typetest.model.enumdiscriminator", }, "type/model/inheritance/nested-discriminator": { "package-name": "typetest-model-nesteddiscriminator", + "namespace": "typetest.model.nesteddiscriminator", }, "type/model/inheritance/not-discriminated": { "package-name": "typetest-model-notdiscriminated", + "namespace": "typetest.model.notdiscriminated", }, "type/model/inheritance/single-discriminator": { "package-name": "typetest-model-singlediscriminator", + "namespace": "typetest.model.singlediscriminator", }, "type/model/inheritance/recursive": { "package-name": "typetest-model-recursive", + "namespace": "typetest.model.recursive", + "use-pyodide": "true", }, "type/model/usage": { "package-name": "typetest-model-usage", + "namespace": "typetest.model.usage", }, "type/model/visibility": [ - { "package-name": "typetest-model-visibility" }, - { "package-name": "headasbooleantrue", "head-as-boolean": "true" }, - { "package-name": "headasbooleanfalse", "head-as-boolean": "false" }, + { + "package-name": "typetest-model-visibility", + "namespace": "typetest.model.visibility", + }, + { + "package-name": "headasbooleantrue", + "namespace": "headasbooleantrue", + "head-as-boolean": "true", + }, + { + "package-name": "headasbooleanfalse", + "namespace": "headasbooleanfalse", + "head-as-boolean": "false", + }, ], "type/property/nullable": { "package-name": "typetest-property-nullable", + "namespace": "typetest.property.nullable", }, "type/property/optionality": { "package-name": "typetest-property-optional", + "namespace": "typetest.property.optional", }, "type/property/additional-properties": { "package-name": "typetest-property-additionalproperties", + "namespace": "typetest.property.additionalproperties", }, "type/scalar": { "package-name": "typetest-scalar", + "namespace": "typetest.scalar", }, "type/property/value-types": { "package-name": "typetest-property-valuetypes", + "namespace": "typetest.property.valuetypes", }, "type/union": { "package-name": "typetest-union", + "namespace": "typetest.union", }, "azure/core/lro/rpc": { "package-name": "azurecore-lro-rpc", + "namespace": "azurecore.lro.rpc", }, "client/structure/multi-client": { "package-name": "client-structure-multiclient", + "namespace": "client.structure.multiclient", }, "client/structure/renamed-operation": { "package-name": "client-structure-renamedoperation", + "namespace": "client.structure.renamedoperation", }, "client/structure/two-operation-group": { "package-name": "client-structure-twooperationgroup", - }, - "client/namespace": { - "enable-typespec-namespace": "true", + "namespace": "client.structure.twooperationgroup", }, }; diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/MANIFEST.in b/packages/typespec-python/test/azure/generated/authentication-api-key/MANIFEST.in index 84258db3b15..805328d742a 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/apikey/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/README.md b/packages/typespec-python/test/azure/generated/authentication-api-key/README.md index 3fb13d287de..97cda271782 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/README.md +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/README.md @@ -1,5 +1,3 @@ - - # Authentication Apikey client library for Python @@ -17,6 +15,7 @@ python -m pip install authentication-apikey - You need an [Azure subscription][azure_sub] to use this package. - An existing Authentication Apikey instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py b/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py index ae301a6bbc7..75ca4137c9e 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-apikey" +PACKAGE_NAMESPACE = "authentication.apikey" PACKAGE_PPRINT_NAME = "Authentication Apikey" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/MANIFEST.in b/packages/typespec-python/test/azure/generated/authentication-http-custom/MANIFEST.in index b61198cfa7f..6f9c2254b26 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/MANIFEST.in @@ -4,4 +4,4 @@ include authentication/http/custom/py.typed recursive-include tests *.py recursive-include samples *.py *.md include authentication/__init__.py -include authentication/http/__init__.py \ No newline at end of file +include authentication/http/__init__.py diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/README.md b/packages/typespec-python/test/azure/generated/authentication-http-custom/README.md index 293fb16a01f..f6c6d0c5fef 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/README.md +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/README.md @@ -1,6 +1,4 @@ - - -# Authentication Http Custom Service client library for Python +# Authentication Http Custom client library for Python ## Getting started @@ -15,7 +13,8 @@ python -m pip install authentication-http-custom - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- An existing Authentication Http Custom Service instance. +- An existing Authentication Http Custom instance. + ## Contributing @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py b/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py index 4fab1b452fb..a6c0d1a1a7b 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-http-custom" -PACKAGE_PPRINT_NAME = "Authentication Http Custom Service" +PACKAGE_NAMESPACE = "authentication.http.custom" +PACKAGE_PPRINT_NAME = "Authentication Http Custom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/MANIFEST.in b/packages/typespec-python/test/azure/generated/authentication-oauth2/MANIFEST.in index 9c73f66d6b1..9bb1ed4315f 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/oauth2/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/README.md b/packages/typespec-python/test/azure/generated/authentication-oauth2/README.md index fb30f67510c..46850484b4a 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/README.md +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/README.md @@ -1,5 +1,3 @@ - - # Authentication Oauth2 client library for Python @@ -16,6 +14,7 @@ python -m pip install authentication-oauth2 - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. - An existing Authentication Oauth2 instance. + #### Create with an Azure Active Directory Credential To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], provide an instance of the desired credential type obtained from the @@ -77,4 +76,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py b/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py index cf71f6ca7bc..b7dbf1ea716 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-oauth2" +PACKAGE_NAMESPACE = "authentication.oauth2" PACKAGE_PPRINT_NAME = "Authentication Oauth2" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-union/MANIFEST.in b/packages/typespec-python/test/azure/generated/authentication-union/MANIFEST.in index 83649fb608a..a8e19db2766 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/authentication-union/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/union/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/azure/generated/authentication-union/README.md b/packages/typespec-python/test/azure/generated/authentication-union/README.md index 3e07ec9cd59..674d710c3fa 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/README.md +++ b/packages/typespec-python/test/azure/generated/authentication-union/README.md @@ -1,5 +1,3 @@ - - # Authentication Union client library for Python @@ -17,6 +15,7 @@ python -m pip install authentication-union - You need an [Azure subscription][azure_sub] to use this package. - An existing Authentication Union instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/authentication-union/setup.py b/packages/typespec-python/test/azure/generated/authentication-union/setup.py index 2cf2e990f92..25db977b7e0 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-union/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-union" +PACKAGE_NAMESPACE = "authentication.union" PACKAGE_PPRINT_NAME = "Authentication Union" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/MANIFEST.in index dca3d6574ff..7c79aa9f273 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/MANIFEST.in @@ -6,4 +6,4 @@ recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py include specs/azure/clientgenerator/__init__.py -include specs/azure/clientgenerator/core/__init__.py \ No newline at end of file +include specs/azure/clientgenerator/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/README.md b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/README.md index 70d89528117..2fc5bbd2b9f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/README.md +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Clientgenerator Core Access client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-clientgenerator-core-access - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Clientgenerator Core Access instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json index 00f5a031481..3fd648f0ea7 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json @@ -1,10 +1,10 @@ { "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Access", "CrossLanguageDefinitionId": { - "specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.NoDecoratorModelInPublic", - "specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal", - "specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic", - "specs.azure.clientgenerator.core.access.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel", + "specs.azure.clientgenerator.core.access.publicoperation.models.NoDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.NoDecoratorModelInPublic", + "specs.azure.clientgenerator.core.access.internaloperation.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal", + "specs.azure.clientgenerator.core.access.publicoperation.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic", + "specs.azure.clientgenerator.core.access.sharedmodelinoperation.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel", "specs.azure.clientgenerator.core.access.AccessClient.public_operation.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic", "specs.azure.clientgenerator.core.access.AccessClient.public_operation.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic", "specs.azure.clientgenerator.core.access.AccessClient.shared_model_in_operation.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py index 577cd2df3bf..7e0d091f44f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-access" +PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.access" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Access" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py index c90e9c86bd3..9a8405bc364 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py @@ -16,12 +16,10 @@ from ._configuration import AccessClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ( - InternalOperationOperations, - PublicOperationOperations, - RelativeModelInOperationOperations, - SharedModelInOperationOperations, -) +from .internaloperation.operations import InternalOperationOperations +from .publicoperation.operations import PublicOperationOperations +from .relativemodelinoperation.operations import RelativeModelInOperationOperations +from .sharedmodelinoperation.operations import SharedModelInOperationOperations class AccessClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py index 9c535497862..0238bdf2f23 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py @@ -15,13 +15,11 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..internaloperation.aio.operations import InternalOperationOperations +from ..publicoperation.aio.operations import PublicOperationOperations +from ..relativemodelinoperation.aio.operations import RelativeModelInOperationOperations +from ..sharedmodelinoperation.aio.operations import SharedModelInOperationOperations from ._configuration import AccessClientConfiguration -from .operations import ( - InternalOperationOperations, - PublicOperationOperations, - RelativeModelInOperationOperations, - SharedModelInOperationOperations, -) class AccessClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py deleted file mode 100644 index 4d4e085659d..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import PublicOperationOperations # type: ignore -from ._operations import InternalOperationOperations # type: ignore -from ._operations import SharedModelInOperationOperations # type: ignore -from ._operations import RelativeModelInOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "PublicOperationOperations", - "InternalOperationOperations", - "SharedModelInOperationOperations", - "RelativeModelInOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py deleted file mode 100644 index a60382927e5..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_internal_operation_internal_decorator_in_internal_request, - build_internal_operation_no_decorator_in_internal_request, - build_internal_operation_public_decorator_in_internal_request, - build_public_operation_no_decorator_in_public_request, - build_public_operation_public_decorator_in_public_request, - build_relative_model_in_operation_discriminator_request, - build_relative_model_in_operation_operation_request, - build_shared_model_in_operation_internal_request, - build_shared_model_in_operation_public_request, -) -from .._configuration import AccessClientConfiguration - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PublicOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`public_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: - """no_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_no_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: - """public_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_public_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class InternalOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`internal_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def _no_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.NoDecoratorModelInInternal: - """no_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_no_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _internal_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.InternalDecoratorModelInInternal: - """internal_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible - with MutableMapping - :rtype: - ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_internal_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _public_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models.PublicDecoratorModelInInternal: - """public_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_public_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class SharedModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`shared_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """public. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """internal. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RelativeModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`relative_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "inner": - { - "name": "Madge" - } - }. - - :keyword name: Required. - :paramtype name: str - :return: OuterModel. The OuterModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_operation_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "kind": "real" - }. - - :keyword kind: Required. - :paramtype kind: str - :return: AbstractModel. The AbstractModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_discriminator_request( - kind=kind, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.AbstractModel, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py new file mode 100644 index 00000000000..05a427c34aa --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import InternalOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "InternalOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py new file mode 100644 index 00000000000..c0355ec5a7c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py @@ -0,0 +1,250 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import AccessClientConfiguration +from ...operations._operations import ( + build_internal_operation_internal_decorator_in_internal_request, + build_internal_operation_no_decorator_in_internal_request, + build_internal_operation_public_decorator_in_internal_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class InternalOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`internal_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def _no_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.NoDecoratorModelInInternal: + """no_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_no_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _internal_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.InternalDecoratorModelInInternal: + """internal_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible + with MutableMapping + :rtype: + ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_internal_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _public_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models.PublicDecoratorModelInInternal: + """public_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_public_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py new file mode 100644 index 00000000000..74869987f06 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + PublicDecoratorModelInInternal, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PublicDecoratorModelInInternal", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py new file mode 100644 index 00000000000..ea6b70f3bc0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field + + +class InternalDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation, should be generated but not exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NoDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation, should be generated but not exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PublicDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation but with public decorator, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py new file mode 100644 index 00000000000..05a427c34aa --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import InternalOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "InternalOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py new file mode 100644 index 00000000000..9b59e8b9398 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py @@ -0,0 +1,305 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import AccessClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_internal_operation_no_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/noDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internal_operation_internal_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internal_operation_public_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class InternalOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`internal_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def _no_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models._models.NoDecoratorModelInInternal: + """no_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_no_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _internal_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.InternalDecoratorModelInInternal: + """internal_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible + with MutableMapping + :rtype: + ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_internal_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _public_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInInternal: + """public_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_public_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py deleted file mode 100644 index 4d4e085659d..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import PublicOperationOperations # type: ignore -from ._operations import InternalOperationOperations # type: ignore -from ._operations import SharedModelInOperationOperations # type: ignore -from ._operations import RelativeModelInOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "PublicOperationOperations", - "InternalOperationOperations", - "SharedModelInOperationOperations", - "RelativeModelInOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py deleted file mode 100644 index 9268632a40e..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py +++ /dev/null @@ -1,856 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from .._configuration import AccessClientConfiguration -from .._model_base import _deserialize -from .._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_public_operation_no_decorator_in_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/publicOperation/noDecoratorInPublic" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_public_operation_public_decorator_in_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_internal_operation_no_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/noDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_internal_operation_internal_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_internal_operation_public_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_shared_model_in_operation_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/sharedModelInOperation/public" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_shared_model_in_operation_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/sharedModelInOperation/internal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_relative_model_in_operation_operation_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/relativeModelInOperation/operation" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_relative_model_in_operation_discriminator_request( # pylint: disable=name-too-long - *, kind: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/relativeModelInOperation/discriminator" - - # Construct parameters - _params["kind"] = _SERIALIZER.query("kind", kind, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PublicOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`public_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: - """no_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_no_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: - """public_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_public_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class InternalOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`internal_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def _no_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models._models.NoDecoratorModelInInternal: - """no_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_no_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _internal_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.InternalDecoratorModelInInternal: - """internal_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible - with MutableMapping - :rtype: - ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_internal_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _public_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInInternal: - """public_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_public_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class SharedModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`shared_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """public. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """internal. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class RelativeModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`relative_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "inner": - { - "name": "Madge" - } - }. - - :keyword name: Required. - :paramtype name: str - :return: OuterModel. The OuterModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_operation_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "kind": "real" - }. - - :keyword kind: Required. - :paramtype kind: str - :return: AbstractModel. The AbstractModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_discriminator_request( - kind=kind, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.AbstractModel, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py new file mode 100644 index 00000000000..43140bc8fe1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PublicOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PublicOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py new file mode 100644 index 00000000000..b420cd126a1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import AccessClientConfiguration +from ...operations._operations import ( + build_public_operation_no_decorator_in_public_request, + build_public_operation_public_decorator_in_public_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PublicOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`public_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: + """no_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_no_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: + """public_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_public_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py index 19e5aaae4b4..783a5b8e283 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py @@ -15,9 +15,7 @@ from ._models import ( # type: ignore NoDecoratorModelInPublic, - PublicDecoratorModelInInternal, PublicDecoratorModelInPublic, - SharedModel, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -25,9 +23,7 @@ __all__ = [ "NoDecoratorModelInPublic", - "PublicDecoratorModelInInternal", "PublicDecoratorModelInPublic", - "SharedModel", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py new file mode 100644 index 00000000000..fbe465d21cb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field + + +class NoDecoratorModelInPublic(_model_base.Model): + """Used in a public operation, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PublicDecoratorModelInPublic(_model_base.Model): + """Used in a public operation, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py new file mode 100644 index 00000000000..43140bc8fe1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PublicOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PublicOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py new file mode 100644 index 00000000000..e1ef42fe680 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py @@ -0,0 +1,218 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import AccessClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_public_operation_no_decorator_in_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/publicOperation/noDecoratorInPublic" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_operation_public_decorator_in_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class PublicOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`public_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: + """no_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_no_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: + """public_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_public_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py new file mode 100644 index 00000000000..c0efa1f86ed --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RelativeModelInOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RelativeModelInOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py new file mode 100644 index 00000000000..2b7b7545e49 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py @@ -0,0 +1,197 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import AccessClientConfiguration +from ...operations._operations import ( + build_relative_model_in_operation_discriminator_request, + build_relative_model_in_operation_operation_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class RelativeModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`relative_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: + """Expected query parameter: name="Madge" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "inner": + { + "name": "Madge" + } + }. + + :keyword name: Required. + :paramtype name: str + :return: OuterModel. The OuterModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_operation_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: + """Expected query parameter: kind="real" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "kind": "real" + }. + + :keyword kind: Required. + :paramtype kind: str + :return: AbstractModel. The AbstractModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_discriminator_request( + kind=kind, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.AbstractModel, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py new file mode 100644 index 00000000000..e3b4c5295f0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py similarity index 52% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py index 73740de086a..b34ddb55b49 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py @@ -8,10 +8,10 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Any, Dict, Literal, Mapping, TYPE_CHECKING, overload +from typing import Dict, Literal, TYPE_CHECKING -from .. import _model_base -from .._model_base import rest_discriminator, rest_field +from ... import _model_base +from ..._model_base import rest_discriminator, rest_field if TYPE_CHECKING: from .. import models as _models @@ -110,90 +110,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InternalDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation, should be generated but not exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NoDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation, should be generated but not exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NoDecoratorModelInPublic(_model_base.Model): - """Used in a public operation, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class OuterModel(BaseModel): """Used in internal operations, should be generated but not exported. @@ -225,62 +141,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation but with public decorator, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PublicDecoratorModelInPublic(_model_base.Model): - """Used in a public operation, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class RealModel(AbstractModel, discriminator="real"): """Used in internal operations, should be generated but not exported. @@ -309,31 +169,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="real", **kwargs) - - -class SharedModel(_model_base.Model): - """Used by both public and internal operation. It should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py new file mode 100644 index 00000000000..c0efa1f86ed --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RelativeModelInOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RelativeModelInOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py new file mode 100644 index 00000000000..87509cc2925 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import AccessClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_relative_model_in_operation_operation_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/relativeModelInOperation/operation" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_relative_model_in_operation_discriminator_request( # pylint: disable=name-too-long + *, kind: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/relativeModelInOperation/discriminator" + + # Construct parameters + _params["kind"] = _SERIALIZER.query("kind", kind, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class RelativeModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`relative_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: + """Expected query parameter: name="Madge" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "inner": + { + "name": "Madge" + } + }. + + :keyword name: Required. + :paramtype name: str + :return: OuterModel. The OuterModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_operation_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: + """Expected query parameter: kind="real" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "kind": "real" + }. + + :keyword kind: Required. + :paramtype kind: str + :return: AbstractModel. The AbstractModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_discriminator_request( + kind=kind, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.AbstractModel, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py new file mode 100644 index 00000000000..bf96eabc126 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import SharedModelInOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SharedModelInOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py new file mode 100644 index 00000000000..c26424be3e5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import AccessClientConfiguration +from ...operations._operations import ( + build_shared_model_in_operation_internal_request, + build_shared_model_in_operation_public_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SharedModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`shared_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """public. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """internal. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py new file mode 100644 index 00000000000..2e391133ec0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + SharedModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SharedModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py new file mode 100644 index 00000000000..a6b27018ff0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field + + +class SharedModel(_model_base.Model): + """Used by both public and internal operation. It should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py new file mode 100644 index 00000000000..bf96eabc126 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import SharedModelInOperationOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SharedModelInOperationOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py new file mode 100644 index 00000000000..35123fea702 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py @@ -0,0 +1,216 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import AccessClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_shared_model_in_operation_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/sharedModelInOperation/public" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_shared_model_in_operation_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/sharedModelInOperation/internal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SharedModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`shared_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """public. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """internal. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in index 4d1bfd40f79..483cd2ac3e0 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in @@ -6,4 +6,4 @@ recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py include specs/azure/clientgenerator/__init__.py -include specs/azure/clientgenerator/core/__init__.py \ No newline at end of file +include specs/azure/clientgenerator/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md index 3174317b475..5f983d2f26e 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Clientgenerator Core Flattenproperty client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-clientgenerator-core-flattenproperty - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Clientgenerator Core Flattenproperty instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py index 9569a683c2f..0ee9c1c929f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-flattenproperty" +PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.flattenproperty" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Flattenproperty" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/MANIFEST.in index 16f4ad95a3f..a9f8e33e3c5 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/MANIFEST.in @@ -6,4 +6,4 @@ recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py include specs/azure/clientgenerator/__init__.py -include specs/azure/clientgenerator/core/__init__.py \ No newline at end of file +include specs/azure/clientgenerator/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/README.md b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/README.md index c211c3e8f86..16fe3886401 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/README.md +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Clientgenerator Core Usage client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-clientgenerator-core-usage - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Clientgenerator Core Usage instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json index 6b76d573f63..0604ce8f7b0 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json @@ -1,11 +1,11 @@ { "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Usage", "CrossLanguageDefinitionId": { - "specs.azure.clientgenerator.core.usage.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel", + "specs.azure.clientgenerator.core.usage.modelinoperation.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel", "specs.azure.clientgenerator.core.usage.models.OrphanModel": "_Specs_.Azure.ClientGenerator.Core.Usage.OrphanModel", - "specs.azure.clientgenerator.core.usage.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel", - "specs.azure.clientgenerator.core.usage.models.ResultModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.ResultModel", - "specs.azure.clientgenerator.core.usage.models.RoundTripModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.RoundTripModel", + "specs.azure.clientgenerator.core.usage.modelinoperation.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel", + "specs.azure.clientgenerator.core.usage.modelinoperation.models.ResultModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.ResultModel", + "specs.azure.clientgenerator.core.usage.modelinoperation.models.RoundTripModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.RoundTripModel", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.input_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.inputToInputOutput", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.output_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.outputToInputOutput", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.model_in_read_only_property": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.modelInReadOnlyProperty" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py index 235071e6759..dae4672f09a 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-usage" +PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.usage" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Usage" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py index b5460b7910d..ffacdd6748c 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py @@ -16,7 +16,7 @@ from ._configuration import UsageClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ModelInOperationOperations +from .modelinoperation.operations import ModelInOperationOperations class UsageClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py index 6df99c466f6..b59d96bdec6 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..modelinoperation.aio.operations import ModelInOperationOperations from ._configuration import UsageClientConfiguration -from .operations import ModelInOperationOperations class UsageClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py index cc2a46337ce..173981c0e4b 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py @@ -27,14 +27,14 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import UsageClientConfiguration from ...operations._operations import ( build_model_in_operation_input_to_input_output_request, build_model_in_operation_model_in_read_only_property_request, build_model_in_operation_output_to_input_output_request, ) -from .._configuration import UsageClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py new file mode 100644 index 00000000000..f4a6043ca66 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + InputModel, + OutputModel, + ResultModel, + RoundTripModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "InputModel", + "OutputModel", + "ResultModel", + "RoundTripModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py new file mode 100644 index 00000000000..70e191dad6c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, TYPE_CHECKING, overload + +from ... import _model_base +from ..._model_base import rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class InputModel(_model_base.Model): + """Usage override to roundtrip. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OutputModel(_model_base.Model): + """Usage override to roundtrip. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResultModel(_model_base.Model): + """ResultModel. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoundTripModel(_model_base.Model): + """RoundTripModel. + + :ivar result: Required. + :vartype result: ~specs.azure.clientgenerator.core.usage.models.ResultModel + """ + + result: "_models.ResultModel" = rest_field(visibility=["read"]) + """Required.""" diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py index 1beec9b9fd7..e1b990cf6ac 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import UsageClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import UsageClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py index e5ed72eb8fc..4fd94e2f8f4 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py @@ -14,22 +14,14 @@ from ._models import ( # type: ignore - InputModel, OrphanModel, - OutputModel, - ResultModel, - RoundTripModel, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "InputModel", "OrphanModel", - "OutputModel", - "ResultModel", - "RoundTripModel", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py index cbc58bcb8c7..ba0d99b7771 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py @@ -7,42 +7,11 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Any, Mapping, TYPE_CHECKING, overload +from typing import Any, Mapping, overload from .. import _model_base from .._model_base import rest_field -if TYPE_CHECKING: - from .. import models as _models - - -class InputModel(_model_base.Model): - """Usage override to roundtrip. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - class OrphanModel(_model_base.Model): """Not used anywhere, but access is override to public so still need to be generated and exported @@ -71,70 +40,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class OutputModel(_model_base.Model): - """Usage override to roundtrip. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResultModel(_model_base.Model): - """ResultModel. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RoundTripModel(_model_base.Model): - """RoundTripModel. - - :ivar result: Required. - :vartype result: ~specs.azure.clientgenerator.core.usage.models.ResultModel - """ - - result: "_models.ResultModel" = rest_field(visibility=["read"]) - """Required.""" diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-basic/MANIFEST.in index 4e049874b25..97c68dbc2c6 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/core/__init__.py \ No newline at end of file +include specs/azure/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/README.md b/packages/typespec-python/test/azure/generated/azure-core-basic/README.md index 1feab0c61bd..3f713ddc99e 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Basic client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-basic - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Basic instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py b/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py index 8fc0e4fe837..3460f166ea5 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-basic" +PACKAGE_NAMESPACE = "specs.azure.core.basic" PACKAGE_PPRINT_NAME = "Specs Azure Core Basic" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/MANIFEST.in index d504b28b9ed..c17ad5a4013 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/MANIFEST.in @@ -6,4 +6,4 @@ recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py include specs/azure/core/__init__.py -include specs/azure/core/lro/__init__.py \ No newline at end of file +include specs/azure/core/lro/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/README.md b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/README.md index 661ab3f6f2b..3bdc77038ff 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Lro Standard client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-lro-standard - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Lro Standard instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py index 1290fcc7e55..5b439895560 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-lro-standard" +PACKAGE_NAMESPACE = "specs.azure.core.lro.standard" PACKAGE_PPRINT_NAME = "Specs Azure Core Lro Standard" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-model/MANIFEST.in index a4fb967a0c4..0020facc5ec 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-model/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/core/__init__.py \ No newline at end of file +include specs/azure/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/README.md b/packages/typespec-python/test/azure/generated/azure-core-model/README.md index 20dd98320a7..eeefc6a47f9 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-model/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Model client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-model - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Model instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/setup.py b/packages/typespec-python/test/azure/generated/azure-core-model/setup.py index e1f39540178..669d45dbb6a 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-model/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-model" +PACKAGE_NAMESPACE = "specs.azure.core.model" PACKAGE_PPRINT_NAME = "Specs Azure Core Model" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-page/MANIFEST.in index 76928ba51d9..8e8c1848412 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-page/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/core/__init__.py \ No newline at end of file +include specs/azure/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/README.md b/packages/typespec-python/test/azure/generated/azure-core-page/README.md index a37788ef567..ce2d6724321 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-page/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Page client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-page - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Page instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/setup.py b/packages/typespec-python/test/azure/generated/azure-core-page/setup.py index f68971a962f..792cec94ece 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-page" +PACKAGE_NAMESPACE = "specs.azure.core.page" PACKAGE_PPRINT_NAME = "Specs Azure Core Page" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-scalar/MANIFEST.in index 49876ec2108..295f0550778 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/core/__init__.py \ No newline at end of file +include specs/azure/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/README.md b/packages/typespec-python/test/azure/generated/azure-core-scalar/README.md index 47715611192..301847f06bd 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Scalar client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-scalar - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Scalar instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py index 80f4168d701..f262a05d768 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-scalar" +PACKAGE_NAMESPACE = "specs.azure.core.scalar" PACKAGE_PPRINT_NAME = "Specs Azure Core Scalar" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-traits/MANIFEST.in index c4559c2de10..52c9896c808 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/core/__init__.py \ No newline at end of file +include specs/azure/core/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/README.md b/packages/typespec-python/test/azure/generated/azure-core-traits/README.md index 99e19bc29f4..da7436fed5d 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Core Traits client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-core-traits - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Core Traits instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py b/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py index 429b952b946..fa6a4de8d3e 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-core-traits" +PACKAGE_NAMESPACE = "specs.azure.core.traits" PACKAGE_PPRINT_NAME = "Specs Azure Core Traits" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in index 8c010cbe4ea..ac8cfc63b5e 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in @@ -1,8 +1,5 @@ include *.md include LICENSE -include specs/azure/example/basic/py.typed +include azureexamplebasicclient/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include specs/__init__.py -include specs/azure/__init__.py -include specs/azure/example/__init__.py \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/README.md b/packages/typespec-python/test/azure/generated/azure-example-basic/README.md index aac41c59d3c..d7888f59848 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/README.md +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/README.md @@ -1,6 +1,4 @@ - - -# Specs Azure Example Basic client library for Python +# Azureexamplebasicclient client library for Python ## Getting started @@ -8,14 +6,15 @@ ### Install the package ```bash -python -m pip install specs-azure-example-basic +python -m pip install azureexamplebasicclient ``` #### Prequisites - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- An existing Specs Azure Example Basic instance. +- An existing Azureexamplebasicclient instance. + ## Contributing @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json index c2aa7467184..3ef9cf51b96 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json @@ -4,7 +4,7 @@ "specs.azure.example.basic.models.ActionRequest": "_Specs_.Azure.Example.Basic.ActionRequest", "specs.azure.example.basic.models.ActionResponse": "_Specs_.Azure.Example.Basic.ActionResponse", "specs.azure.example.basic.models.Model": "_Specs_.Azure.Example.Basic.Model", - "specs.azure.example.basic.models.EnumEnum": "_Specs_.Azure.Example.Basic.Enum", - "specs.azure.example.basic.AzureExampleClient.basic_action": "AzureExampleBasicClient.AzureExampleClient.basicAction" + "azureexamplebasicclient.models.EnumEnum": "_Specs_.Azure.Example.Basic.Enum", + "azureexamplebasicclient.AzureExampleClient.basic_action": "AzureExampleBasicClient.AzureExampleClient.basicAction" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py new file mode 100644 index 00000000000..508179d9aff --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AzureExampleClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AzureExampleClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_client.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_client.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py index 14df3fdec52..47c7e8fe831 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "specs-azure-example-basic/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "azureexamplebasicclient/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_model_base.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_model_base.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_model_base.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_model_base.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py index 0e8f98efa24..f42785623dc 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py @@ -25,7 +25,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from ...specs.azure.example.basic import models as _models from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Serializer from .._vendor import AzureExampleClientMixinABC @@ -81,7 +81,7 @@ def basic_action( """basic_action. :param body: Required. - :type body: ~specs.azure.example.basic.models.ActionRequest + :type body: ~azureexamplebasicclient.models.ActionRequest :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. @@ -90,7 +90,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -110,7 +110,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -136,7 +136,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -147,13 +147,13 @@ def basic_action( """basic_action. :param body: Is one of the following types: ActionRequest, JSON, IO[bytes] Required. - :type body: ~specs.azure.example.basic.models.ActionRequest or JSON or IO[bytes] + :type body: ~azureexamplebasicclient.models.ActionRequest or JSON or IO[bytes] :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. :paramtype header_param: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_serialization.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_serialization.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_serialization.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_serialization.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_vendor.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_version.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_version.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_version.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_version.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_client.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py index b851be5e7f1..6b119b8c22a 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "specs-azure-example-basic/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "azureexamplebasicclient/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py similarity index 93% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py index 475464cd1bb..ac4b7f8501b 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ....specs.azure.example.basic import models as _models from ..._model_base import SdkJSONEncoder, _deserialize from ..._operations._operations import build_azure_example_basic_action_request from .._vendor import AzureExampleClientMixinABC @@ -55,7 +55,7 @@ async def basic_action( """basic_action. :param body: Required. - :type body: ~specs.azure.example.basic.models.ActionRequest + :type body: ~azureexamplebasicclient.models.ActionRequest :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. @@ -64,7 +64,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -84,7 +84,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -110,7 +110,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -121,13 +121,13 @@ async def basic_action( """basic_action. :param body: Is one of the following types: ActionRequest, JSON, IO[bytes] Required. - :type body: ~specs.azure.example.basic.models.ActionRequest or JSON or IO[bytes] + :type body: ~azureexamplebasicclient.models.ActionRequest or JSON or IO[bytes] :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. :paramtype header_param: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~specs.azure.example.basic.models.ActionResponse + :rtype: ~azureexamplebasicclient.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_vendor.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/py.typed b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/py.typed similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/py.typed rename to packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/py.typed diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py index 8fc73742343..1c8a9539164 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from specs.azure.example.basic import AzureExampleClient +from azureexamplebasicclient import AzureExampleClient """ # PREREQUISITES - pip install specs-azure-example-basic + pip install azureexamplebasicclient # USAGE python basic.py """ diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py index 6039e937d65..d56991c5c24 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py @@ -5,9 +5,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from azureexamplebasicclient import AzureExampleClient from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer import functools -from specs.azure.example.basic import AzureExampleClient class AzureExampleClientTestBase(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py index 64243921636..2308707d85b 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py @@ -5,8 +5,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from azureexamplebasicclient.aio import AzureExampleClient from devtools_testutils import AzureRecordedTestCase -from specs.azure.example.basic.aio import AzureExampleClient class AzureExampleClientTestBaseAsync(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py index d6e671e064b..d1bac43338d 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py @@ -12,11 +12,12 @@ from setuptools import setup, find_packages -PACKAGE_NAME = "specs-azure-example-basic" -PACKAGE_PPRINT_NAME = "Specs Azure Example Basic" +PACKAGE_NAME = "azureexamplebasicclient" +PACKAGE_NAMESPACE = "azureexamplebasicclient" +PACKAGE_PPRINT_NAME = "Azureexamplebasicclient" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, @@ -53,15 +52,11 @@ packages=find_packages( exclude=[ "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "specs", - "specs.azure", - "specs.azure.example", ] ), include_package_data=True, package_data={ - "specs.azure.example.basic": ["py.typed"], + "azureexamplebasicclient": ["py.typed"], }, install_requires=[ "isodate>=0.6.1", diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py index 508179d9aff..d55ccad1f57 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py @@ -1,32 +1 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import AzureExampleClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AzureExampleClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py index 37203ba9955..cf815435ecb 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from ......azureexamplebasicclient import _model_base +from ......azureexamplebasicclient._model_base import rest_field if TYPE_CHECKING: from .. import models as _models @@ -22,7 +22,7 @@ class ActionRequest(_model_base.Model): :ivar string_property: Required. :vartype string_property: str :ivar model_property: - :vartype model_property: ~specs.azure.example.basic.models.Model + :vartype model_property: ~azureexamplebasicclient.models.Model :ivar array_property: :vartype array_property: list[str] :ivar record_property: @@ -68,7 +68,7 @@ class ActionResponse(_model_base.Model): :ivar string_property: Required. :vartype string_property: str :ivar model_property: - :vartype model_property: ~specs.azure.example.basic.models.Model + :vartype model_property: ~azureexamplebasicclient.models.Model :ivar array_property: :vartype array_property: list[str] :ivar record_property: @@ -116,7 +116,7 @@ class Model(_model_base.Model): :ivar float32_property: :vartype float32_property: float :ivar enum_property: "EnumValue1" - :vartype enum_property: str or ~specs.azure.example.basic.models.EnumEnum + :vartype enum_property: str or ~azureexamplebasicclient.models.EnumEnum """ int32_property: Optional[int] = rest_field( diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-payload-pageable/MANIFEST.in index 839bc06fb1e..fd0f30e0133 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/payload/__init__.py \ No newline at end of file +include specs/azure/payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/README.md b/packages/typespec-python/test/azure/generated/azure-payload-pageable/README.md index 437f7dbef6f..57255e1503f 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/README.md +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Payload Pageable client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-payload-pageable - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Payload Pageable instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py index cc90f0f1958..1941f2ff51b 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specs-azure-payload-pageable" +PACKAGE_NAMESPACE = "specs.azure.payload.pageable" PACKAGE_PPRINT_NAME = "Specs Azure Payload Pageable" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/MANIFEST.in index a0f57f8f826..7a746f67c5c 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/MANIFEST.in @@ -4,4 +4,4 @@ include azure/resourcemanager/commonproperties/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/resourcemanager/__init__.py \ No newline at end of file +include azure/resourcemanager/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/README.md b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/README.md index e4ab35d16ca..48cc6bca302 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/README.md +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/README.md @@ -1,5 +1,3 @@ - - # Azure Resourcemanager Commonproperties client library for Python @@ -16,6 +14,7 @@ python -m pip install azure-resourcemanager-commonproperties - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. - An existing Azure Resourcemanager Commonproperties instance. + #### Create with an Azure Active Directory Credential To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], provide an instance of the desired credential type obtained from the @@ -77,4 +76,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py index 0646ae4dc6e..6bd36ac2325 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "azure-resourcemanager-commonproperties" +PACKAGE_NAMESPACE = "azure.resourcemanager.commonproperties" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Commonproperties" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/MANIFEST.in index 2927e9da325..07365352828 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/MANIFEST.in @@ -4,4 +4,4 @@ include azure/resourcemanager/operationtemplates/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/resourcemanager/__init__.py \ No newline at end of file +include azure/resourcemanager/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/README.md b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/README.md index 809efaf9315..53bcfc7c7df 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/README.md +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/README.md @@ -1,5 +1,3 @@ - - # Azure Resourcemanager Operationtemplates client library for Python @@ -16,6 +14,7 @@ python -m pip install azure-resourcemanager-operationtemplates - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. - An existing Azure Resourcemanager Operationtemplates instance. + #### Create with an Azure Active Directory Credential To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], provide an instance of the desired credential type obtained from the @@ -77,4 +76,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py index 9ea33e0e256..fe3af20d1cc 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "azure-resourcemanager-operationtemplates" +PACKAGE_NAMESPACE = "azure.resourcemanager.operationtemplates" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Operationtemplates" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/MANIFEST.in index e21224becd5..cf76444d775 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/MANIFEST.in @@ -4,4 +4,4 @@ include azure/resourcemanager/resources/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/resourcemanager/__init__.py \ No newline at end of file +include azure/resourcemanager/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/README.md b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/README.md index cd5ed676609..3da3b9e6961 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/README.md +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/README.md @@ -1,5 +1,3 @@ - - # Azure Resourcemanager Resources client library for Python @@ -16,6 +14,7 @@ python -m pip install azure-resourcemanager-resources - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. - An existing Azure Resourcemanager Resources instance. + #### Create with an Azure Active Directory Credential To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], provide an instance of the desired credential type obtained from the @@ -77,4 +76,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py index 30edaf2a8fb..c6ac1585a1e 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "azure-resourcemanager-resources" +PACKAGE_NAMESPACE = "azure.resourcemanager.resources" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Resources" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/MANIFEST.in index beed8344015..27df710116d 100644 --- a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/MANIFEST.in @@ -4,4 +4,4 @@ include azure/specialheaders/xmsclientrequestid/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/specialheaders/__init__.py \ No newline at end of file +include azure/specialheaders/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/README.md b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/README.md index 9043e7ec7da..f9d2ce6b04f 100644 --- a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/README.md +++ b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/README.md @@ -1,5 +1,3 @@ - - # Azure Specialheaders Xmsclientrequestid client library for Python @@ -17,6 +15,7 @@ python -m pip install azure-specialheaders-xmsclientrequestid - You need an [Azure subscription][azure_sub] to use this package. - An existing Azure Specialheaders Xmsclientrequestid instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py index c5d4520cdd9..9febfc7ae18 100644 --- a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "azure-specialheaders-xmsclientrequestid" +PACKAGE_NAMESPACE = "azure.specialheaders.xmsclientrequestid" PACKAGE_PPRINT_NAME = "Azure Specialheaders Xmsclientrequestid" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in index 22469ecc129..0e0b6259b7f 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in @@ -4,4 +4,4 @@ include azurecore/lro/rpc/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azurecore/__init__.py -include azurecore/lro/__init__.py \ No newline at end of file +include azurecore/lro/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md index 05cd95edd34..b3fbc9ac0b1 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md @@ -1,5 +1,3 @@ - - # Azurecore Lro Rpc client library for Python @@ -17,6 +15,7 @@ python -m pip install azurecore-lro-rpc - You need an [Azure subscription][azure_sub] to use this package. - An existing Azurecore Lro Rpc instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py index 6b2ced72468..87b48d64ab7 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "azurecore-lro-rpc" +PACKAGE_NAMESPACE = "azurecore.lro.rpc" PACKAGE_PPRINT_NAME = "Azurecore Lro Rpc" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-namespace/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-namespace/MANIFEST.in index 276d7d1b1dd..381b472228a 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-namespace/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include client/clientnamespace/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include client/__init__.py \ No newline at end of file +include client/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-namespace/README.md b/packages/typespec-python/test/azure/generated/client-namespace/README.md index ead84bb0c3f..ae107e7adb9 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/README.md +++ b/packages/typespec-python/test/azure/generated/client-namespace/README.md @@ -1,5 +1,3 @@ - - # Client Clientnamespace client library for Python @@ -17,6 +15,7 @@ python -m pip install client-clientnamespace - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Clientnamespace instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-namespace/apiview-properties.json b/packages/typespec-python/test/azure/generated/client-namespace/apiview-properties.json index d033f24aafd..f2235386cb8 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/client-namespace/apiview-properties.json @@ -4,7 +4,7 @@ "client.clientnamespace.first.models.FirstClientResult": "Client.ClientNamespace.FirstModel.FirstClientResult", "client.clientnamespace.second.models.SecondClientResult": "Client.ClientNamespace.Second.Model.SecondClientResult", "client.clientnamespace.models.SecondClientEnumType": "Client.ClientNamespace.Second.Model.SecondClientEnumType", - "client.clientnamespace.ClientNamespaceSecondClient.get_second": "ClientNameSpaceClient.ClientNamespaceSecondClient.getSecond", - "client.clientnamespace.ClientNamespaceFirstClient.get_first": "ClientNameSpaceClient.ClientNamespaceFirstClient.getFirst" + "client.clientnamespace.ClientNamespaceFirstClient.get_first": "ClientNameSpaceClient.ClientNamespaceFirstClient.getFirst", + "client.clientnamespace.ClientNamespaceSecondClient.get_second": "ClientNameSpaceClient.ClientNamespaceSecondClient.getSecond" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py index 0f337afcc7c..6e14a00961a 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py @@ -26,7 +26,7 @@ from .._model_base import _deserialize from .._serialization import Serializer from .._vendor import ClientNamespaceFirstClientMixinABC -from ..first import models as _first_models2 +from ..first import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -56,7 +56,7 @@ def build_client_namespace_first_get_first_request(**kwargs: Any) -> HttpRequest class ClientNamespaceFirstClientOperationsMixin(ClientNamespaceFirstClientMixinABC): # pylint: disable=name-too-long @distributed_trace - def get_first(self, **kwargs: Any) -> _first_models2.FirstClientResult: + def get_first(self, **kwargs: Any) -> _models.FirstClientResult: """get_first. :return: FirstClientResult. The FirstClientResult is compatible with MutableMapping @@ -74,7 +74,7 @@ def get_first(self, **kwargs: Any) -> _first_models2.FirstClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_first_models2.FirstClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models.FirstClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_first_get_first_request( headers=_headers, @@ -104,7 +104,7 @@ def get_first(self, **kwargs: Any) -> _first_models2.FirstClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_first_models2.FirstClientResult, response.json()) + deserialized = _deserialize(_models.FirstClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py index daeb3184681..9b4344934d5 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py @@ -25,7 +25,7 @@ from ..._model_base import _deserialize from ..._operations._operations import build_client_namespace_first_get_first_request -from ...first import models as _first_models3 +from ...first import models as _models from .._vendor import ClientNamespaceFirstClientMixinABC if sys.version_info >= (3, 9): @@ -39,7 +39,7 @@ class ClientNamespaceFirstClientOperationsMixin(ClientNamespaceFirstClientMixinABC): # pylint: disable=name-too-long @distributed_trace_async - async def get_first(self, **kwargs: Any) -> _first_models3.FirstClientResult: + async def get_first(self, **kwargs: Any) -> _models.FirstClientResult: """get_first. :return: FirstClientResult. The FirstClientResult is compatible with MutableMapping @@ -57,7 +57,7 @@ async def get_first(self, **kwargs: Any) -> _first_models3.FirstClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_first_models3.FirstClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models.FirstClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_first_get_first_request( headers=_headers, @@ -87,7 +87,7 @@ async def get_first(self, **kwargs: Any) -> _first_models3.FirstClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_first_models3.FirstClientResult, response.json()) + deserialized = _deserialize(_models.FirstClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py index c8e0068ad3e..02360c2b1d1 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._model_base import _deserialize from ..._serialization import Serializer from .._vendor import ClientNamespaceSecondClientMixinABC @@ -56,7 +56,7 @@ def build_client_namespace_second_get_second_request(**kwargs: Any) -> HttpReque class ClientNamespaceSecondClientOperationsMixin(ClientNamespaceSecondClientMixinABC): # pylint: disable=name-too-long @distributed_trace - def get_second(self, **kwargs: Any) -> _models1.SecondClientResult: + def get_second(self, **kwargs: Any) -> _models.SecondClientResult: """get_second. :return: SecondClientResult. The SecondClientResult is compatible with MutableMapping @@ -74,7 +74,7 @@ def get_second(self, **kwargs: Any) -> _models1.SecondClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.SecondClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SecondClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_second_get_second_request( headers=_headers, @@ -104,7 +104,7 @@ def get_second(self, **kwargs: Any) -> _models1.SecondClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.SecondClientResult, response.json()) + deserialized = _deserialize(_models.SecondClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py index ae9b491e736..6fae69b1001 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models as _models2 +from ... import models as _models from ...._model_base import _deserialize from ..._operations._operations import build_client_namespace_second_get_second_request from .._vendor import ClientNamespaceSecondClientMixinABC @@ -39,7 +39,7 @@ class ClientNamespaceSecondClientOperationsMixin(ClientNamespaceSecondClientMixinABC): # pylint: disable=name-too-long @distributed_trace_async - async def get_second(self, **kwargs: Any) -> _models2.SecondClientResult: + async def get_second(self, **kwargs: Any) -> _models.SecondClientResult: """get_second. :return: SecondClientResult. The SecondClientResult is compatible with MutableMapping @@ -57,7 +57,7 @@ async def get_second(self, **kwargs: Any) -> _models2.SecondClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.SecondClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SecondClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_second_get_second_request( headers=_headers, @@ -87,7 +87,7 @@ async def get_second(self, **kwargs: Any) -> _models2.SecondClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.SecondClientResult, response.json()) + deserialized = _deserialize(_models.SecondClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py index b7624ebb7f5..eaaede5dbec 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py @@ -13,7 +13,7 @@ from ..._model_base import rest_field if TYPE_CHECKING: - from ..sub import models as _sub_models2 + from ..sub import models as _models class SecondClientResult(_model_base.Model): @@ -23,7 +23,7 @@ class SecondClientResult(_model_base.Model): :vartype type: str or ~client.clientnamespace.models.SecondClientEnumType """ - type: Union[str, "_sub_models2.SecondClientEnumType"] = rest_field( + type: Union[str, "_models.SecondClientEnumType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Required. \"second\"""" @@ -32,7 +32,7 @@ class SecondClientResult(_model_base.Model): def __init__( self, *, - type: Union[str, "_sub_models2.SecondClientEnumType"], + type: Union[str, "_models.SecondClientEnumType"], ) -> None: ... @overload diff --git a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/conftest.py index 2e36252b815..6b58c0a8856 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/conftest.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/conftest.py @@ -21,19 +21,6 @@ # For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): - namespacesecond_subscription_id = os.environ.get( - "NAMESPACESECOND_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" - ) - namespacesecond_tenant_id = os.environ.get("NAMESPACESECOND_TENANT_ID", "00000000-0000-0000-0000-000000000000") - namespacesecond_client_id = os.environ.get("NAMESPACESECOND_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - namespacesecond_client_secret = os.environ.get( - "NAMESPACESECOND_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer(regex=namespacesecond_subscription_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=namespacesecond_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=namespacesecond_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=namespacesecond_client_secret, value="00000000-0000-0000-0000-000000000000") - namespacefirst_subscription_id = os.environ.get( "NAMESPACEFIRST_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" ) @@ -47,6 +34,19 @@ def add_sanitizers(test_proxy): add_general_regex_sanitizer(regex=namespacefirst_client_id, value="00000000-0000-0000-0000-000000000000") add_general_regex_sanitizer(regex=namespacefirst_client_secret, value="00000000-0000-0000-0000-000000000000") + namespacesecond_subscription_id = os.environ.get( + "NAMESPACESECOND_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + namespacesecond_tenant_id = os.environ.get("NAMESPACESECOND_TENANT_ID", "00000000-0000-0000-0000-000000000000") + namespacesecond_client_id = os.environ.get("NAMESPACESECOND_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + namespacesecond_client_secret = os.environ.get( + "NAMESPACESECOND_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=namespacesecond_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=namespacesecond_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=namespacesecond_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=namespacesecond_client_secret, value="00000000-0000-0000-0000-000000000000") + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") add_header_regex_sanitizer(key="Cookie", value="cookie;") add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer.py index ae0a5a9af2f..e8a57ef35a2 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer.py @@ -11,33 +11,33 @@ import functools -class ClientNamespaceSecondClientTestBase(AzureRecordedTestCase): +class ClientNamespaceFirstClientTestBase(AzureRecordedTestCase): def create_client(self, endpoint): - credential = self.get_credential(ClientNamespaceSecondClient) + credential = self.get_credential(ClientNamespaceFirstClient) return self.create_client_from_credential( - ClientNamespaceSecondClient, + ClientNamespaceFirstClient, credential=credential, endpoint=endpoint, ) -NamespaceSecondPreparer = functools.partial( - PowerShellPreparer, "namespacesecond", namespacesecond_endpoint="https://fake_namespacesecond_endpoint.com" +NamespaceFirstPreparer = functools.partial( + PowerShellPreparer, "namespacefirst", namespacefirst_endpoint="https://fake_namespacefirst_endpoint.com" ) -class ClientNamespaceFirstClientTestBase(AzureRecordedTestCase): +class ClientNamespaceSecondClientTestBase(AzureRecordedTestCase): def create_client(self, endpoint): - credential = self.get_credential(ClientNamespaceFirstClient) + credential = self.get_credential(ClientNamespaceSecondClient) return self.create_client_from_credential( - ClientNamespaceFirstClient, + ClientNamespaceSecondClient, credential=credential, endpoint=endpoint, ) -NamespaceFirstPreparer = functools.partial( - PowerShellPreparer, "namespacefirst", namespacefirst_endpoint="https://fake_namespacefirst_endpoint.com" +NamespaceSecondPreparer = functools.partial( + PowerShellPreparer, "namespacesecond", namespacesecond_endpoint="https://fake_namespacesecond_endpoint.com" ) diff --git a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer_async.py index 20a78dc28f9..e6496e014fc 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer_async.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/generated_tests/testpreparer_async.py @@ -10,23 +10,23 @@ from devtools_testutils import AzureRecordedTestCase -class ClientNamespaceSecondClientTestBaseAsync(AzureRecordedTestCase): +class ClientNamespaceFirstClientTestBaseAsync(AzureRecordedTestCase): def create_async_client(self, endpoint): - credential = self.get_credential(ClientNamespaceSecondClient, is_async=True) + credential = self.get_credential(ClientNamespaceFirstClient, is_async=True) return self.create_client_from_credential( - ClientNamespaceSecondClient, + ClientNamespaceFirstClient, credential=credential, endpoint=endpoint, ) -class ClientNamespaceFirstClientTestBaseAsync(AzureRecordedTestCase): +class ClientNamespaceSecondClientTestBaseAsync(AzureRecordedTestCase): def create_async_client(self, endpoint): - credential = self.get_credential(ClientNamespaceFirstClient, is_async=True) + credential = self.get_credential(ClientNamespaceSecondClient, is_async=True) return self.create_client_from_credential( - ClientNamespaceFirstClient, + ClientNamespaceSecondClient, credential=credential, endpoint=endpoint, ) diff --git a/packages/typespec-python/test/azure/generated/client-namespace/setup.py b/packages/typespec-python/test/azure/generated/client-namespace/setup.py index 9cefe649c8a..49394ddc8a7 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/setup.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-clientnamespace" +PACKAGE_NAMESPACE = "client.clientnamespace" PACKAGE_PPRINT_NAME = "Client Clientnamespace" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-naming/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-naming/MANIFEST.in index aa54588bce0..bd52233e27f 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-naming/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include client/naming/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include client/__init__.py \ No newline at end of file +include client/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/README.md b/packages/typespec-python/test/azure/generated/client-naming/README.md index 622cac7dd9f..a8d74fedab6 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/README.md +++ b/packages/typespec-python/test/azure/generated/client-naming/README.md @@ -1,5 +1,3 @@ - - # Client Naming client library for Python @@ -17,6 +15,7 @@ python -m pip install client-naming - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Naming instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json b/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json index 7dfbf5f5d35..f53258040f5 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json @@ -1,11 +1,11 @@ { "CrossLanguagePackageId": "Client.Naming", "CrossLanguageDefinitionId": { - "client.naming.models.ClientModel": "Client.Naming.Model.ModelWithClientClientName", - "client.naming.models.ClientNameAndJsonEncodedNameModel": "Client.Naming.Property.ClientNameAndJsonEncodedNameModel", - "client.naming.models.ClientNameModel": "Client.Naming.Property.ClientNameModel", - "client.naming.models.LanguageClientNameModel": "Client.Naming.Property.LanguageClientNameModel", - "client.naming.models.PythonModel": "Client.Naming.Model.ModelWithLanguageClientName", + "client.naming.model.models.ClientModel": "Client.Naming.Model.ModelWithClientClientName", + "client.naming.property.models.ClientNameAndJsonEncodedNameModel": "Client.Naming.Property.ClientNameAndJsonEncodedNameModel", + "client.naming.property.models.ClientNameModel": "Client.Naming.Property.ClientNameModel", + "client.naming.property.models.LanguageClientNameModel": "Client.Naming.Property.LanguageClientNameModel", + "client.naming.model.models.PythonModel": "Client.Naming.Model.ModelWithLanguageClientName", "client.naming.models.ClientExtensibleEnum": "Client.Naming.UnionEnum.ServerExtensibleEnum", "client.naming.models.ExtensibleEnum": "Client.Naming.UnionEnum.ExtensibleEnum", "client.naming.NamingClient.client_model.client": "Client.Naming.Model.client", diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py index 7395edb6afa..99fff63a856 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py @@ -15,8 +15,10 @@ from azure.core.rest import HttpRequest, HttpResponse from ._configuration import NamingClientConfiguration +from ._operations import NamingClientOperationsMixin from ._serialization import Deserializer, Serializer -from .operations import ClientModelOperations, NamingClientOperationsMixin, UnionEnumOperations +from .model.operations import ClientModelOperations +from .unionenum.operations import UnionEnumOperations class NamingClient(NamingClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py similarity index 84% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py index 82100c3183f..7ac2ad46845 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ClientModelOperations # type: ignore -from ._operations import UnionEnumOperations # type: ignore from ._operations import NamingClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -21,8 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ClientModelOperations", - "UnionEnumOperations", "NamingClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py index 7b535881495..7efe47c6117 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -11,7 +10,6 @@ import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload -from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,11 +23,10 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models -from .._configuration import NamingClientConfiguration from .._model_base import SdkJSONEncoder -from .._serialization import Deserializer, Serializer +from .._serialization import Serializer from .._vendor import NamingClientMixinABC +from ..property import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -43,60 +40,6 @@ _SERIALIZER.client_side_validation = False -def build_client_model_client_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/client/naming/model/client" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_client_model_language_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/client/naming/model/language" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_union_enum_union_enum_name_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/client/naming/union-enum/union-enum-name" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_union_enum_union_enum_member_name_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/client/naming/union-enum/union-enum-member-name" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - def build_naming_client_name_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/client/naming/operation" @@ -177,348 +120,6 @@ def build_naming_response_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, **kwargs) -class ClientModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.NamingClient`'s - :attr:`client_model` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: ~client.naming.models.ClientModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def client( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """client. - - :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_client_model_client_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def language(self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. - - :param body: Required. - :type body: ~client.naming.models.PythonModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def language( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """language. - - :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_client_model_language_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class UnionEnumOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.NamingClient`'s - :attr:`union_enum` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def union_enum_name( # pylint: disable=inconsistent-return-statements - self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any - ) -> None: - """union_enum_name. - - :param body: "value1" Required. - :type body: str or ~client.naming.models.ClientExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def union_enum_member_name( # pylint: disable=inconsistent-return-statements - self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any - ) -> None: - """union_enum_member_name. - - :param body: Known values are: "value1" and "value2". Required. - :type body: str or ~client.naming.models.ExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_member_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class NamingClientOperationsMixin(NamingClientMixinABC): @distributed_trace diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py index 440347432ac..50d97733725 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py @@ -15,8 +15,10 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..model.aio.operations import ClientModelOperations +from ..unionenum.aio.operations import UnionEnumOperations from ._configuration import NamingClientConfiguration -from .operations import ClientModelOperations, NamingClientOperationsMixin, UnionEnumOperations +from ._operations import NamingClientOperationsMixin class NamingClient(NamingClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py similarity index 84% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py index 82100c3183f..7ac2ad46845 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ClientModelOperations # type: ignore -from ._operations import UnionEnumOperations # type: ignore from ._operations import NamingClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -21,8 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ClientModelOperations", - "UnionEnumOperations", "NamingClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py index feb60837ffe..e9e1bf65792 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py @@ -11,7 +11,6 @@ import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload -from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +24,8 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_client_model_client_request, - build_client_model_language_request, +from ..._operations._operations import ( build_naming_client_name_request, build_naming_client_request, build_naming_compatible_with_encoded_name_request, @@ -38,10 +33,8 @@ build_naming_parameter_request, build_naming_request_request, build_naming_response_request, - build_union_enum_union_enum_member_name_request, - build_union_enum_union_enum_name_request, ) -from .._configuration import NamingClientConfiguration +from ...property import models as _models from .._vendor import NamingClientMixinABC if sys.version_info >= (3, 9): @@ -53,342 +46,6 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ClientModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.aio.NamingClient`'s - :attr:`client_model` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: ~client.naming.models.ClientModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """client. - - :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_client_model_client_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def language( - self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """language. - - :param body: Required. - :type body: ~client.naming.models.PythonModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """language. - - :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_client_model_language_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class UnionEnumOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.aio.NamingClient`'s - :attr:`union_enum` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def union_enum_name(self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any) -> None: - """union_enum_name. - - :param body: "value1" Required. - :type body: str or ~client.naming.models.ClientExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def union_enum_member_name(self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any) -> None: - """union_enum_member_name. - - :param body: Known values are: "value1" and "value2". Required. - :type body: str or ~client.naming.models.ExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_member_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class NamingClientOperationsMixin(NamingClientMixinABC): @distributed_trace_async diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py new file mode 100644 index 00000000000..3ff0937a326 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ClientModelOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ClientModelOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py similarity index 72% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py index fc7afacdbe6..063a604a6da 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py @@ -25,10 +25,10 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer -from ...operations._operations import build_explicit_body_simple_request, build_implicit_body_simple_request -from .._configuration import BasicClientConfiguration +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import NamingClientConfiguration +from ...operations._operations import build_client_model_client_request, build_client_model_language_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -37,32 +37,31 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -_Unset: Any = object() -class ExplicitBodyOperations: +class ClientModelOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~parameters.basic.aio.BasicClient`'s - :attr:`explicit_body` attribute. + :class:`~client.naming.aio.NamingClient`'s + :attr:`client_model` attribute. """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. - :type body: ~parameters.basic.models.User + :type body: ~client.naming.models.ClientModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -72,8 +71,8 @@ async def simple(self, body: _models.User, *, content_type: str = "application/j """ @overload - async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. :type body: JSON @@ -86,8 +85,8 @@ async def simple(self, body: JSON, *, content_type: str = "application/json", ** """ @overload - async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. :type body: IO[bytes] @@ -100,11 +99,11 @@ async def simple(self, body: IO[bytes], *, content_type: str = "application/json """ @distributed_trace_async - async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: - """simple. + async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """client. - :param body: Is one of the following types: User, JSON, IO[bytes] Required. - :type body: ~parameters.basic.models.User or JSON or IO[bytes] + :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -130,7 +129,7 @@ async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_explicit_body_simple_request( + _request = build_client_model_client_request( content_type=content_type, content=_content, headers=_headers, @@ -155,30 +154,14 @@ async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any if cls: return cls(pipeline_response, None, {}) # type: ignore - -class ImplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.aio.BasicClient`'s - :attr:`implicit_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @overload - async def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def language( + self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """language. - :keyword name: Required. - :paramtype name: str + :param body: Required. + :type body: ~client.naming.models.PythonModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -188,8 +171,8 @@ async def simple(self, *, name: str, content_type: str = "application/json", **k """ @overload - async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. :param body: Required. :type body: JSON @@ -202,8 +185,8 @@ async def simple(self, body: JSON, *, content_type: str = "application/json", ** """ @overload - async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + async def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. :param body: Required. :type body: IO[bytes] @@ -216,13 +199,11 @@ async def simple(self, body: IO[bytes], *, content_type: str = "application/json """ @distributed_trace_async - async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any) -> None: - """simple. + async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """language. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str + :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -241,11 +222,6 @@ async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Un content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -253,7 +229,7 @@ async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Un else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_implicit_body_simple_request( + _request = build_client_model_language_request( content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py new file mode 100644 index 00000000000..d1e064dc7e8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ClientModel, + PythonModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ClientModel", + "PythonModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py new file mode 100644 index 00000000000..66f5314aa50 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field + + +class ClientModel(_model_base.Model): + """ClientModel. + + :ivar default_name: Pass in true. Required. + :vartype default_name: bool + """ + + default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) + """Pass in true. Required.""" + + @overload + def __init__( + self, + *, + default_name: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PythonModel(_model_base.Model): + """PythonModel. + + :ivar default_name: Pass in true. Required. + :vartype default_name: bool + """ + + default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) + """Pass in true. Required.""" + + @overload + def __init__( + self, + *, + default_name: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py new file mode 100644 index 00000000000..3ff0937a326 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ClientModelOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ClientModelOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py similarity index 72% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py index ee879c1bebb..b5546f194b3 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py @@ -25,9 +25,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import BasicClientConfiguration -from .._model_base import SdkJSONEncoder -from .._serialization import Deserializer, Serializer +from ..._configuration import NamingClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -36,63 +36,62 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -_Unset: Any = object() _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_explicit_body_simple_request(**kwargs: Any) -> HttpRequest: +def build_client_model_client_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/basic/explicit-body/simple" + _url = "/client/naming/model/client" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_implicit_body_simple_request(**kwargs: Any) -> HttpRequest: +def build_client_model_language_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/basic/implicit-body/simple" + _url = "/client/naming/model/language" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -class ExplicitBodyOperations: +class ClientModelOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~parameters.basic.BasicClient`'s - :attr:`explicit_body` attribute. + :class:`~client.naming.NamingClient`'s + :attr:`client_model` attribute. """ def __init__(self, *args, **kwargs): input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. - :type body: ~parameters.basic.models.User + :type body: ~client.naming.models.ClientModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -102,8 +101,8 @@ def simple(self, body: _models.User, *, content_type: str = "application/json", """ @overload - def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. :type body: JSON @@ -116,8 +115,8 @@ def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. :param body: Required. :type body: IO[bytes] @@ -130,13 +129,13 @@ def simple(self, body: IO[bytes], *, content_type: str = "application/json", **k """ @distributed_trace - def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any + def client( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any ) -> None: - """simple. + """client. - :param body: Is one of the following types: User, JSON, IO[bytes] Required. - :type body: ~parameters.basic.models.User or JSON or IO[bytes] + :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -162,7 +161,7 @@ def simple( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_explicit_body_simple_request( + _request = build_client_model_client_request( content_type=content_type, content=_content, headers=_headers, @@ -187,30 +186,12 @@ def simple( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore - -class ImplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.BasicClient`'s - :attr:`implicit_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @overload - def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def language(self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. - :keyword name: Required. - :paramtype name: str + :param body: Required. + :type body: ~client.naming.models.PythonModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -220,8 +201,8 @@ def simple(self, *, name: str, content_type: str = "application/json", **kwargs: """ @overload - def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. :param body: Required. :type body: JSON @@ -234,8 +215,8 @@ def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. + def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. :param body: Required. :type body: IO[bytes] @@ -248,15 +229,13 @@ def simple(self, body: IO[bytes], *, content_type: str = "application/json", **k """ @distributed_trace - def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + def language( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any ) -> None: - """simple. + """language. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str + :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -275,11 +254,6 @@ def simple( # pylint: disable=inconsistent-return-statements content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -287,7 +261,7 @@ def simple( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_implicit_body_simple_request( + _request = build_client_model_language_request( content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py similarity index 83% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py index 4c81085e1ca..b73edb03d39 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py @@ -14,29 +14,18 @@ from ._models import ( # type: ignore - ClientModel, ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, - PythonModel, -) - -from ._enums import ( # type: ignore - ClientExtensibleEnum, - ExtensibleEnum, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ClientModel", "ClientNameAndJsonEncodedNameModel", "ClientNameModel", "LanguageClientNameModel", - "PythonModel", - "ClientExtensibleEnum", - "ExtensibleEnum", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py similarity index 64% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py index 50f6302b0ee..0dff17bc0f8 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py @@ -9,36 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field - - -class ClientModel(_model_base.Model): - """ClientModel. - - :ivar default_name: Pass in true. Required. - :vartype default_name: bool - """ - - default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) - """Pass in true. Required.""" - - @overload - def __init__( - self, - *, - default_name: bool, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) +from ... import _model_base +from ..._model_base import rest_field class ClientNameAndJsonEncodedNameModel(_model_base.Model): @@ -123,31 +95,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class PythonModel(_model_base.Model): - """PythonModel. - - :ivar default_name: Pass in true. Required. - :vartype default_name: bool - """ - - default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) - """Pass in true. Required.""" - - @overload - def __init__( - self, - *, - default_name: bool, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py new file mode 100644 index 00000000000..a748f5b26cf --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import UnionEnumOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "UnionEnumOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py new file mode 100644 index 00000000000..df8fbba54d2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py @@ -0,0 +1,160 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +import sys +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import NamingClientConfiguration +from ...operations._operations import ( + build_union_enum_union_enum_member_name_request, + build_union_enum_union_enum_name_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class UnionEnumOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.aio.NamingClient`'s + :attr:`union_enum` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def union_enum_name(self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any) -> None: + """union_enum_name. + + :param body: "value1" Required. + :type body: str or ~client.naming.models.ClientExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def union_enum_member_name(self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any) -> None: + """union_enum_member_name. + + :param body: Known values are: "value1" and "value2". Required. + :type body: str or ~client.naming.models.ExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_member_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py new file mode 100644 index 00000000000..b9f176e9350 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._enums import ( # type: ignore + ClientExtensibleEnum, + ExtensibleEnum, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ClientExtensibleEnum", + "ExtensibleEnum", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_enums.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_enums.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_enums.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_enums.py diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py new file mode 100644 index 00000000000..a748f5b26cf --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import UnionEnumOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "UnionEnumOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py new file mode 100644 index 00000000000..9693f3c5bab --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py @@ -0,0 +1,189 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +import sys +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import NamingClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_union_enum_union_enum_name_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/client/naming/union-enum/union-enum-name" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_union_enum_union_enum_member_name_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/client/naming/union-enum/union-enum-member-name" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class UnionEnumOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.NamingClient`'s + :attr:`union_enum` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def union_enum_name( # pylint: disable=inconsistent-return-statements + self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any + ) -> None: + """union_enum_name. + + :param body: "value1" Required. + :type body: str or ~client.naming.models.ClientExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def union_enum_member_name( # pylint: disable=inconsistent-return-statements + self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any + ) -> None: + """union_enum_member_name. + + :param body: Known values are: "value1" and "value2". Required. + :type body: str or ~client.naming.models.ExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_member_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/setup.py b/packages/typespec-python/test/azure/generated/client-naming/setup.py index 4caa19959df..9dcf5de764a 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/setup.py +++ b/packages/typespec-python/test/azure/generated/client-naming/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-naming" +PACKAGE_NAMESPACE = "client.naming" PACKAGE_PPRINT_NAME = "Client Naming" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-structure-default/MANIFEST.in index 934e192d9bd..11fe6edde9b 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-structure-default/MANIFEST.in @@ -4,4 +4,4 @@ include client/structure/service/py.typed recursive-include tests *.py recursive-include samples *.py *.md include client/__init__.py -include client/structure/__init__.py \ No newline at end of file +include client/structure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/README.md b/packages/typespec-python/test/azure/generated/client-structure-default/README.md index 6779c61e802..7a4af6bd987 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/README.md +++ b/packages/typespec-python/test/azure/generated/client-structure-default/README.md @@ -1,5 +1,3 @@ - - # Client Structure Service client library for Python @@ -17,6 +15,7 @@ python -m pip install client-structure-service - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Structure Service instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py index 14f4ad71030..b6a75654931 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py @@ -17,7 +17,9 @@ from . import models as _models from ._configuration import ServiceClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import BarOperations, BazOperations, FooOperations, QuxOperations, ServiceClientOperationsMixin +from .baz.operations import BazOperations +from .operations import BarOperations, FooOperations, ServiceClientOperationsMixin +from .qux.operations import QuxOperations class ServiceClient(ServiceClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py index a59b3a26d57..ada2682da91 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py @@ -16,8 +16,10 @@ from .. import models as _models from .._serialization import Deserializer, Serializer +from ..baz.aio.operations import BazOperations +from ..qux.aio.operations import QuxOperations from ._configuration import ServiceClientConfiguration -from .operations import BarOperations, BazOperations, FooOperations, QuxOperations, ServiceClientOperationsMixin +from .operations import BarOperations, FooOperations, ServiceClientOperationsMixin class ServiceClient(ServiceClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py index 3560145a703..7a5f390b339 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import BazOperations # type: ignore -from ._operations import QuxOperations # type: ignore from ._operations import FooOperations # type: ignore from ._operations import BarOperations # type: ignore from ._operations import ServiceClientOperationsMixin # type: ignore @@ -23,8 +21,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "BazOperations", - "QuxOperations", "FooOperations", "BarOperations", "ServiceClientOperationsMixin", diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index 88bf08cc6a1..7c85c16509a 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -26,11 +26,8 @@ from ...operations._operations import ( build_bar_five_request, build_bar_six_request, - build_baz_foo_seven_request, build_foo_four_request, build_foo_three_request, - build_qux_bar_nine_request, - build_qux_eight_request, build_service_one_request, build_service_two_request, ) @@ -45,91 +42,6 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class BazOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`baz` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) - - -class QuxOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`qux` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) - - @distributed_trace_async - async def eight(self, **kwargs: Any) -> None: - """eight. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_eight_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class FooOperations: """ .. warning:: @@ -437,129 +349,3 @@ async def two(self, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class BazFooOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`foo` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def seven(self, **kwargs: Any) -> None: - """seven. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_baz_foo_seven_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QuxBarOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`bar` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def nine(self, **kwargs: Any) -> None: - """nine. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_bar_nine_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py new file mode 100644 index 00000000000..b4a3b318840 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import BazOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "BazOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py new file mode 100644 index 00000000000..6d4d32f5dac --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import ServiceClientConfiguration +from ...operations._operations import build_baz_foo_seven_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BazOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`baz` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) + + +class BazFooOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`foo` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def seven(self, **kwargs: Any) -> None: + """seven. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_baz_foo_seven_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py new file mode 100644 index 00000000000..b4a3b318840 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import BazOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "BazOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py new file mode 100644 index 00000000000..3b901e16c9b --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ..._configuration import ServiceClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_baz_foo_seven_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/seven" + + return HttpRequest(method="POST", url=_url, **kwargs) + + +class BazOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`baz` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) + + +class BazFooOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`foo` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """seven. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_baz_foo_seven_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py index 3560145a703..7a5f390b339 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import BazOperations # type: ignore -from ._operations import QuxOperations # type: ignore from ._operations import FooOperations # type: ignore from ._operations import BarOperations # type: ignore from ._operations import ServiceClientOperationsMixin # type: ignore @@ -23,8 +21,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "BazOperations", - "QuxOperations", "FooOperations", "BarOperations", "ServiceClientOperationsMixin", diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py index 5dc8e031ea2..f5590ae3ed6 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -36,13 +36,6 @@ _SERIALIZER.client_side_validation = False -def build_qux_eight_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/eight" - - return HttpRequest(method="POST", url=_url, **kwargs) - - def build_foo_three_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/three" @@ -85,105 +78,6 @@ def build_service_two_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, **kwargs) -def build_baz_foo_seven_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/seven" - - return HttpRequest(method="POST", url=_url, **kwargs) - - -def build_qux_bar_nine_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/nine" - - return HttpRequest(method="POST", url=_url, **kwargs) - - -class BazOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`baz` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) - - -class QuxOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`qux` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) - - @distributed_trace - def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """eight. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_eight_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class FooOperations: """ .. warning:: @@ -491,129 +385,3 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class BazFooOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`foo` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """seven. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_baz_foo_seven_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QuxBarOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`bar` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """nine. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_bar_nine_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py new file mode 100644 index 00000000000..fde2c7d7e1c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QuxOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QuxOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py new file mode 100644 index 00000000000..a792374cd9b --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py @@ -0,0 +1,161 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import ServiceClientConfiguration +from ...operations._operations import build_qux_bar_nine_request, build_qux_eight_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QuxOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`qux` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) + + @distributed_trace_async + async def eight(self, **kwargs: Any) -> None: + """eight. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_eight_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QuxBarOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`bar` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def nine(self, **kwargs: Any) -> None: + """nine. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_bar_nine_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_patch.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_patch.py rename to packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py new file mode 100644 index 00000000000..fde2c7d7e1c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QuxOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QuxOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py new file mode 100644 index 00000000000..9d5fc6ad969 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ..._configuration import ServiceClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_qux_eight_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/eight" + + return HttpRequest(method="POST", url=_url, **kwargs) + + +def build_qux_bar_nine_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/nine" + + return HttpRequest(method="POST", url=_url, **kwargs) + + +class QuxOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`qux` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) + + @distributed_trace + def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """eight. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_eight_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QuxBarOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`bar` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """nine. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_bar_nine_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/setup.py b/packages/typespec-python/test/azure/generated/client-structure-default/setup.py index 607f049fabe..d185242eb43 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-structure-service" +PACKAGE_NAMESPACE = "client.structure.service" PACKAGE_PPRINT_NAME = "Client Structure Service" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-structure-multiclient/MANIFEST.in index 4bb00a0079d..66f32f4018a 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/MANIFEST.in @@ -4,4 +4,4 @@ include client/structure/multiclient/py.typed recursive-include tests *.py recursive-include samples *.py *.md include client/__init__.py -include client/structure/__init__.py \ No newline at end of file +include client/structure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/README.md b/packages/typespec-python/test/azure/generated/client-structure-multiclient/README.md index 035a5f541c0..52ef7204406 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/README.md +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/README.md @@ -1,5 +1,3 @@ - - # Client Structure Multiclient client library for Python @@ -17,6 +15,7 @@ python -m pip install client-structure-multiclient - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Structure Multiclient instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py index b3eaf8db0f1..973b557b260 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-structure-multiclient" +PACKAGE_NAMESPACE = "client.structure.multiclient" PACKAGE_PPRINT_NAME = "Client Structure Multiclient" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/MANIFEST.in index 3a4391bd1d3..a4594a808a8 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/MANIFEST.in @@ -4,4 +4,4 @@ include client/structure/renamedoperation/py.typed recursive-include tests *.py recursive-include samples *.py *.md include client/__init__.py -include client/structure/__init__.py \ No newline at end of file +include client/structure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/README.md b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/README.md index ed5e29b0a6a..9f59c5cd008 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/README.md +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/README.md @@ -1,5 +1,3 @@ - - # Client Structure Renamedoperation client library for Python @@ -17,6 +15,7 @@ python -m pip install client-structure-renamedoperation - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Structure Renamedoperation instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py index 6ca49c86070..6f48d76701c 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-structure-renamedoperation" +PACKAGE_NAMESPACE = "client.structure.renamedoperation" PACKAGE_PPRINT_NAME = "Client Structure Renamedoperation" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/MANIFEST.in b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/MANIFEST.in index 9c5717d6a5d..9d712ef0e08 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/MANIFEST.in @@ -4,4 +4,4 @@ include client/structure/twooperationgroup/py.typed recursive-include tests *.py recursive-include samples *.py *.md include client/__init__.py -include client/structure/__init__.py \ No newline at end of file +include client/structure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/README.md b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/README.md index f721cf35cf3..48a8a6e43b4 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/README.md +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/README.md @@ -1,5 +1,3 @@ - - # Client Structure Twooperationgroup client library for Python @@ -17,6 +15,7 @@ python -m pip install client-structure-twooperationgroup - You need an [Azure subscription][azure_sub] to use this package. - An existing Client Structure Twooperationgroup instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py index daf8c469ec6..f7023ecbb49 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "client-structure-twooperationgroup" +PACKAGE_NAMESPACE = "client.structure.twooperationgroup" PACKAGE_PPRINT_NAME = "Client Structure Twooperationgroup" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/MANIFEST.in b/packages/typespec-python/test/azure/generated/encode-bytes/MANIFEST.in index 75b3ca6eac0..8b0e3efbc6c 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/encode-bytes/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/bytes/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/README.md b/packages/typespec-python/test/azure/generated/encode-bytes/README.md index 3fe91d2d5e5..7478d6fa50b 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/README.md +++ b/packages/typespec-python/test/azure/generated/encode-bytes/README.md @@ -1,5 +1,3 @@ - - # Encode Bytes client library for Python @@ -17,6 +15,7 @@ python -m pip install encode-bytes - You need an [Azure subscription][azure_sub] to use this package. - An existing Encode Bytes instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/_client.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/_client.py index 9aa25b58d3d..4d979e2f6ef 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/_client.py @@ -16,13 +16,11 @@ from ._configuration import BytesClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ( - HeaderOperations, - PropertyOperations, - QueryOperations, - RequestBodyOperations, - ResponseBodyOperations, -) +from .header.operations import HeaderOperations +from .property.operations import PropertyOperations +from .query.operations import QueryOperations +from .requestbody.operations import RequestBodyOperations +from .responsebody.operations import ResponseBodyOperations class BytesClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/_client.py index 570eae35b69..8926193e032 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/_client.py @@ -15,14 +15,12 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..header.aio.operations import HeaderOperations +from ..property.aio.operations import PropertyOperations +from ..query.aio.operations import QueryOperations +from ..requestbody.aio.operations import RequestBodyOperations +from ..responsebody.aio.operations import ResponseBodyOperations from ._configuration import BytesClientConfiguration -from .operations import ( - HeaderOperations, - PropertyOperations, - QueryOperations, - RequestBodyOperations, - ResponseBodyOperations, -) class BytesClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/__init__.py deleted file mode 100644 index a19ae0a5209..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore -from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore -from ._operations import RequestBodyOperations # type: ignore -from ._operations import ResponseBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", - "PropertyOperations", - "HeaderOperations", - "RequestBodyOperations", - "ResponseBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py deleted file mode 100644 index 885bcdf486d..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py +++ /dev/null @@ -1,1543 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_header_base64_request, - build_header_base64_url_array_request, - build_header_base64_url_request, - build_header_default_request, - build_property_base64_request, - build_property_base64_url_array_request, - build_property_base64_url_request, - build_property_default_request, - build_query_base64_request, - build_query_base64_url_array_request, - build_query_base64_url_request, - build_query_default_request, - build_request_body_base64_request, - build_request_body_base64_url_request, - build_request_body_custom_content_type_request, - build_request_body_default_request, - build_request_body_octet_stream_request, - build_response_body_base64_request, - build_response_body_base64_url_request, - build_response_body_custom_content_type_request, - build_response_body_default_request, - build_response_body_octet_stream_request, -) -from .._configuration import BytesClientConfiguration - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: bytes, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, *, value: bytes, **kwargs: Any) -> None: - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PropertyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`property` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: ~encode.bytes.models.DefaultBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def default( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def default( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: ~encode.bytes.models.Base64BytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url_array( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url_array( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] - Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_array_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: bytes, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, *, value: bytes, **kwargs: Any) -> None: - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RequestBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`request_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, value: bytes, **kwargs: Any) -> None: - """default. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def octet_stream(self, value: bytes, **kwargs: Any) -> None: - """octet_stream. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_octet_stream_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def custom_content_type(self, value: bytes, **kwargs: Any) -> None: - """custom_content_type. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_custom_content_type_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, value: bytes, **kwargs: Any) -> None: - """base64. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore - - _request = build_request_body_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`response_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, **kwargs: Any) -> bytes: - """default. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def octet_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: - """octet_stream. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_octet_stream_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def custom_content_type(self, **kwargs: Any) -> AsyncIterator[bytes]: - """custom_content_type. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_custom_content_type_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def base64(self, **kwargs: Any) -> bytes: - """base64. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def base64_url(self, **kwargs: Any) -> bytes: - """base64_url. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_url_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64url") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/__init__.py index 72a7d58cf05..1ab30f60268 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import QueryOperations # type: ignore from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryOperations", "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_operations.py new file mode 100644 index 00000000000..a3ca2196205 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_operations.py @@ -0,0 +1,244 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BytesClientConfiguration +from ...operations._operations import ( + build_header_base64_request, + build_header_base64_url_array_request, + build_header_base64_url_request, + build_header_default_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.aio.BytesClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, value: bytes, **kwargs: Any) -> None: + """default. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64(self, *, value: bytes, **kwargs: Any) -> None: + """base64. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: + """base64_url. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_url_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: + """base64_url_array. + + :keyword value: Required. + :paramtype value: list[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_url_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/__init__.py index 72a7d58cf05..1ab30f60268 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import QueryOperations # type: ignore from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryOperations", "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_operations.py new file mode 100644 index 00000000000..949a7f2c551 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_operations.py @@ -0,0 +1,292 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import BytesClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_header_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/bytes/header/default" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "bytearray") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/bytes/header/base64" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "bytearray") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/bytes/header/base64url" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "base64") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/bytes/header/base64url-array" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "[base64]", div=",") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.BytesClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """default. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64_url. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_url_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64_url_array( # pylint: disable=inconsistent-return-statements + self, *, value: List[bytes], **kwargs: Any + ) -> None: + """base64_url_array. + + :keyword value: Required. + :paramtype value: list[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_base64_url_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/header/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/__init__.py deleted file mode 100644 index a19ae0a5209..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore -from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore -from ._operations import RequestBodyOperations # type: ignore -from ._operations import ResponseBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", - "PropertyOperations", - "HeaderOperations", - "RequestBodyOperations", - "ResponseBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py deleted file mode 100644 index e7563868849..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py +++ /dev/null @@ -1,1827 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from .._configuration import BytesClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_query_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/default" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64url" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "base64") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64url-array" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "[base64]", div=",") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_property_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/default" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64url" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_url_array_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64url-array" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_header_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/default" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64url" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "base64") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64url-array" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "[base64]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_request_body_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/default" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_octet_stream_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/octet-stream" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/custom-content-type" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/base64" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/base64url" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_response_body_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/body/response/default" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_octet_stream_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/octet-stream") - - # Construct URL - _url = "/encode/bytes/body/response/octet-stream" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "image/png") - - # Construct URL - _url = "/encode/bytes/body/response/custom-content-type" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/body/response/base64" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/body/response/base64url" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[bytes], **kwargs: Any - ) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PropertyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`property` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: ~encode.bytes.models.DefaultBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: ~encode.bytes.models.Base64BytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url_array( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url_array( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] - Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_array_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[bytes], **kwargs: Any - ) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RequestBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`request_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """octet_stream. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_octet_stream_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def custom_content_type( # pylint: disable=inconsistent-return-statements - self, value: bytes, **kwargs: Any - ) -> None: - """custom_content_type. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_custom_content_type_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore - - _request = build_request_body_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`response_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, **kwargs: Any) -> bytes: - """default. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def octet_stream(self, **kwargs: Any) -> Iterator[bytes]: - """octet_stream. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_octet_stream_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def custom_content_type(self, **kwargs: Any) -> Iterator[bytes]: - """custom_content_type. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_custom_content_type_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def base64(self, **kwargs: Any) -> bytes: - """base64. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def base64_url(self, **kwargs: Any) -> bytes: - """base64_url. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_url_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64url") - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py new file mode 100644 index 00000000000..06696b42f49 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py @@ -0,0 +1,541 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from .... import models as _models +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BytesClientConfiguration +from ...operations._operations import ( + build_property_base64_request, + build_property_base64_url_array_request, + build_property_base64_url_request, + build_property_default_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PropertyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.aio.BytesClient`'s + :attr:`property` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def default( + self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: ~encode.bytes.models.DefaultBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def default( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def default( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def default( + self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_default_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def base64( + self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: ~encode.bytes.models.Base64BytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def base64( + self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def base64_url( + self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: ~encode.bytes.models.Base64urlBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64_url( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64_url( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def base64_url( + self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_url_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def base64_url_array( + self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: ~encode.bytes.models.Base64urlArrayBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64_url_array( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def base64_url_array( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def base64_url_array( + self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] + Required. + :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_url_array_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py new file mode 100644 index 00000000000..1ca521d55b0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py @@ -0,0 +1,606 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._configuration import BytesClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_property_default_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/bytes/property/default" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_base64_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/bytes/property/base64" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_base64_url_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/bytes/property/base64url" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_base64_url_array_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/bytes/property/base64url-array" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class PropertyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.BytesClient`'s + :attr:`property` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def default( + self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: ~encode.bytes.models.DefaultBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def default( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def default( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def default( + self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultBytesProperty: + """default. + + :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] + :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.DefaultBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_default_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def base64( + self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: ~encode.bytes.models.Base64BytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def base64( + self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64BytesProperty: + """base64. + + :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] + :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64BytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def base64_url( + self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: ~encode.bytes.models.Base64urlBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64_url( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64_url( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def base64_url( + self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlBytesProperty: + """base64_url. + + :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. + :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] + :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping + :rtype: ~encode.bytes.models.Base64urlBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_url_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def base64_url_array( + self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: ~encode.bytes.models.Base64urlArrayBytesProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64_url_array( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def base64_url_array( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def base64_url_array( + self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: + """base64_url_array. + + :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] + Required. + :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] + :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with + MutableMapping + :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_base64_url_array_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_operations.py new file mode 100644 index 00000000000..304c091da52 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_operations.py @@ -0,0 +1,244 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BytesClientConfiguration +from ...operations._operations import ( + build_query_base64_request, + build_query_base64_url_array_request, + build_query_base64_url_request, + build_query_default_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.aio.BytesClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, value: bytes, **kwargs: Any) -> None: + """default. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64(self, *, value: bytes, **kwargs: Any) -> None: + """base64. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: + """base64_url. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_url_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: + """base64_url_array. + + :keyword value: Required. + :paramtype value: list[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_url_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_operations.py new file mode 100644 index 00000000000..a70db0f7f6e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_operations.py @@ -0,0 +1,292 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import BytesClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/bytes/query/default" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "bytearray") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/bytes/query/base64" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "bytearray") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/bytes/query/base64url" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "base64") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/bytes/query/base64url-array" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "[base64]", div=",") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.BytesClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """default. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64_url. + + :keyword value: Required. + :paramtype value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_url_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64_url_array( # pylint: disable=inconsistent-return-statements + self, *, value: List[bytes], **kwargs: Any + ) -> None: + """base64_url_array. + + :keyword value: Required. + :paramtype value: list[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_base64_url_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/query/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/__init__.py new file mode 100644 index 00000000000..4b425cb03d6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RequestBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RequestBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py new file mode 100644 index 00000000000..ed6160b520b --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py @@ -0,0 +1,315 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BytesClientConfiguration +from ...operations._operations import ( + build_request_body_base64_request, + build_request_body_base64_url_request, + build_request_body_custom_content_type_request, + build_request_body_default_request, + build_request_body_octet_stream_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class RequestBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.aio.BytesClient`'s + :attr:`request_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, value: bytes, **kwargs: Any) -> None: + """default. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + + _request = build_request_body_default_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def octet_stream(self, value: bytes, **kwargs: Any) -> None: + """octet_stream. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = value + + _request = build_request_body_octet_stream_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def custom_content_type(self, value: bytes, **kwargs: Any) -> None: + """custom_content_type. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = value + + _request = build_request_body_custom_content_type_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64(self, value: bytes, **kwargs: Any) -> None: + """base64. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + + _request = build_request_body_base64_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def base64_url(self, value: bytes, **kwargs: Any) -> None: + """base64_url. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore + + _request = build_request_body_base64_url_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/__init__.py new file mode 100644 index 00000000000..4b425cb03d6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import RequestBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RequestBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py new file mode 100644 index 00000000000..02b7e379940 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py @@ -0,0 +1,378 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import BytesClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_request_body_default_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/encode/bytes/body/request/default" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_request_body_octet_stream_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/encode/bytes/body/request/octet-stream" + + # Construct headers + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_request_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/encode/bytes/body/request/custom-content-type" + + # Construct headers + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_request_body_base64_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/encode/bytes/body/request/base64" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_request_body_base64_url_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/encode/bytes/body/request/base64url" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class RequestBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.bytes.BytesClient`'s + :attr:`request_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """default. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + + _request = build_request_body_default_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """octet_stream. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = value + + _request = build_request_body_octet_stream_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def custom_content_type( # pylint: disable=inconsistent-return-statements + self, value: bytes, **kwargs: Any + ) -> None: + """custom_content_type. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = value + + _request = build_request_body_custom_content_type_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + + _request = build_request_body_base64_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def base64_url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """base64_url. + + :param value: Required. + :type value: bytes + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore + + _request = build_request_body_base64_url_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/__init__.py new file mode 100644 index 00000000000..903f00096e2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResponseBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResponseBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py similarity index 67% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py index 78df2b590bb..8b8c2bc4eff 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -22,18 +22,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from ... import models as _models -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BytesClientConfiguration from ...operations._operations import ( - build_different_body_get_avatar_as_json_request, - build_different_body_get_avatar_as_png_request, - build_same_body_get_avatar_as_jpeg_request, - build_same_body_get_avatar_as_png_request, + build_response_body_base64_request, + build_response_body_base64_url_request, + build_response_body_custom_content_type_request, + build_response_body_default_request, + build_response_body_octet_stream_request, ) -from .._configuration import ContentNegotiationClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -43,29 +42,29 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class SameBodyOperations: +class ResponseBodyOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s - :attr:`same_body` attribute. + :class:`~encode.bytes.aio.BytesClient`'s + :attr:`response_body` attribute. """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: - """get_avatar_as_png. + async def default(self, **kwargs: Any) -> bytes: + """default. - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :return: bytes + :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -76,14 +75,12 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[bytes] = kwargs.pop("cls", None) - _request = build_same_body_get_avatar_as_png_request( - accept=accept, + _request = build_response_body_default_request( headers=_headers, params=_params, ) @@ -92,7 +89,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -108,19 +105,19 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: - """get_avatar_as_jpeg. + async def octet_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: + """octet_stream. :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] @@ -134,14 +131,12 @@ async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_same_body_get_avatar_as_jpeg_request( - accept=accept, + _request = build_response_body_octet_stream_request( headers=_headers, params=_params, ) @@ -176,27 +171,9 @@ async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: return deserialized # type: ignore - -class DifferentBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s - :attr:`different_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: - """get_avatar_as_png. + async def custom_content_type(self, **kwargs: Any) -> AsyncIterator[bytes]: + """custom_content_type. :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] @@ -210,14 +187,12 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_different_body_get_avatar_as_png_request( - accept=accept, + _request = build_response_body_custom_content_type_request( headers=_headers, params=_params, ) @@ -253,11 +228,11 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: return deserialized # type: ignore @distributed_trace_async - async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: - """get_avatar_as_json. + async def base64(self, **kwargs: Any) -> bytes: + """base64. - :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping - :rtype: ~payload.contentnegotiation.models.PngImageAsJson + :return: bytes + :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -268,14 +243,12 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[bytes] = kwargs.pop("cls", None) - _request = build_different_body_get_avatar_as_json_request( - accept=accept, + _request = build_response_body_base64_request( headers=_headers, params=_params, ) @@ -300,15 +273,68 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(bytes, response.json(), format="base64") + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def base64_url(self, **kwargs: Any) -> bytes: + """base64_url. + + :return: bytes + :rtype: bytes + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[bytes] = kwargs.pop("cls", None) + + _request = build_response_body_base64_url_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PngImageAsJson, response.json()) + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/__init__.py new file mode 100644 index 00000000000..903f00096e2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResponseBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResponseBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py similarity index 64% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py index 0db304fee4f..7ab897fa50f 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar +from typing import Any, Callable, Dict, Iterator, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -24,10 +24,9 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models -from .._configuration import ContentNegotiationClientConfiguration -from .._model_base import _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import BytesClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -40,81 +39,99 @@ _SERIALIZER.client_side_validation = False -def build_same_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_response_body_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/content-negotiation/same-body" + _url = "/encode/bytes/body/response/default" # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_same_body_get_avatar_as_jpeg_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_response_body_octet_stream_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + accept = _headers.pop("Accept", "application/octet-stream") + # Construct URL - _url = "/content-negotiation/same-body" + _url = "/encode/bytes/body/response/octet-stream" # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_different_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_response_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + accept = _headers.pop("Accept", "image/png") + # Construct URL - _url = "/content-negotiation/different-body" + _url = "/encode/bytes/body/response/custom-content-type" # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_different_body_get_avatar_as_json_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_response_body_base64_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/content-negotiation/different-body" + _url = "/encode/bytes/body/response/base64" # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -class SameBodyOperations: +def build_response_body_base64_url_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/bytes/body/response/base64url" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class ResponseBodyOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~payload.contentnegotiation.ContentNegotiationClient`'s - :attr:`same_body` attribute. + :class:`~encode.bytes.BytesClient`'s + :attr:`response_body` attribute. """ def __init__(self, *args, **kwargs): input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: - """get_avatar_as_png. + def default(self, **kwargs: Any) -> bytes: + """default. - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :return: bytes + :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -125,14 +142,12 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[bytes] = kwargs.pop("cls", None) - _request = build_same_body_get_avatar_as_png_request( - accept=accept, + _request = build_response_body_default_request( headers=_headers, params=_params, ) @@ -141,7 +156,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -157,19 +172,19 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: - """get_avatar_as_jpeg. + def octet_stream(self, **kwargs: Any) -> Iterator[bytes]: + """octet_stream. :return: Iterator[bytes] :rtype: Iterator[bytes] @@ -183,14 +198,12 @@ def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_same_body_get_avatar_as_jpeg_request( - accept=accept, + _request = build_response_body_octet_stream_request( headers=_headers, params=_params, ) @@ -225,27 +238,9 @@ def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: return deserialized # type: ignore - -class DifferentBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.contentnegotiation.ContentNegotiationClient`'s - :attr:`different_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: - """get_avatar_as_png. + def custom_content_type(self, **kwargs: Any) -> Iterator[bytes]: + """custom_content_type. :return: Iterator[bytes] :rtype: Iterator[bytes] @@ -259,14 +254,12 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_different_body_get_avatar_as_png_request( - accept=accept, + _request = build_response_body_custom_content_type_request( headers=_headers, params=_params, ) @@ -302,11 +295,11 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: return deserialized # type: ignore @distributed_trace - def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: - """get_avatar_as_json. + def base64(self, **kwargs: Any) -> bytes: + """base64. - :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping - :rtype: ~payload.contentnegotiation.models.PngImageAsJson + :return: bytes + :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -317,14 +310,12 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[bytes] = kwargs.pop("cls", None) - _request = build_different_body_get_avatar_as_json_request( - accept=accept, + _request = build_response_body_base64_request( headers=_headers, params=_params, ) @@ -349,15 +340,68 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(bytes, response.json(), format="base64") + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def base64_url(self, **kwargs: Any) -> bytes: + """base64_url. + + :return: bytes + :rtype: bytes + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[bytes] = kwargs.pop("cls", None) + + _request = build_response_body_base64_url_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PngImageAsJson, response.json()) + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/setup.py b/packages/typespec-python/test/azure/generated/encode-bytes/setup.py index fd3910dcc68..4a8e29f8fbc 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-bytes" +PACKAGE_NAMESPACE = "encode.bytes" PACKAGE_PPRINT_NAME = "Encode Bytes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/MANIFEST.in b/packages/typespec-python/test/azure/generated/encode-datetime/MANIFEST.in index 63254f8a20e..d686e124bfd 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/encode-datetime/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/datetime/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/README.md b/packages/typespec-python/test/azure/generated/encode-datetime/README.md index d278743310d..28e62626bc3 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/README.md +++ b/packages/typespec-python/test/azure/generated/encode-datetime/README.md @@ -1,5 +1,3 @@ - - # Encode Datetime client library for Python @@ -17,6 +15,7 @@ python -m pip install encode-datetime - You need an [Azure subscription][azure_sub] to use this package. - An existing Encode Datetime instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/_client.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/_client.py index 7ac54f958ea..19b86c9b1df 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/_client.py @@ -16,7 +16,10 @@ from ._configuration import DatetimeClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import HeaderOperations, PropertyOperations, QueryOperations, ResponseHeaderOperations +from .header.operations import HeaderOperations +from .property.operations import PropertyOperations +from .query.operations import QueryOperations +from .responseheader.operations import ResponseHeaderOperations class DatetimeClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/_client.py index d831b20a0c6..6eacd70de08 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/_client.py @@ -15,8 +15,11 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..header.aio.operations import HeaderOperations +from ..property.aio.operations import PropertyOperations +from ..query.aio.operations import QueryOperations +from ..responseheader.aio.operations import ResponseHeaderOperations from ._configuration import DatetimeClientConfiguration -from .operations import HeaderOperations, PropertyOperations, QueryOperations, ResponseHeaderOperations class DatetimeClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/__init__.py deleted file mode 100644 index d28aab0d0c1..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore -from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore -from ._operations import ResponseHeaderOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", - "PropertyOperations", - "HeaderOperations", - "ResponseHeaderOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_operations.py new file mode 100644 index 00000000000..d8f3f86b207 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_operations.py @@ -0,0 +1,293 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DatetimeClientConfiguration +from ...operations._operations import ( + build_header_default_request, + build_header_rfc3339_request, + build_header_rfc7231_request, + build_header_unix_timestamp_array_request, + build_header_unix_timestamp_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.aio.DatetimeClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """default. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def rfc3339(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """rfc3339. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_rfc3339_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def rfc7231(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """rfc7231. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_rfc7231_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def unix_timestamp(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """unix_timestamp. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_unix_timestamp_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def unix_timestamp_array(self, *, value: List[datetime.datetime], **kwargs: Any) -> None: + """unix_timestamp_array. + + :keyword value: Required. + :paramtype value: list[~datetime.datetime] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_unix_timestamp_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_patch.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_operations.py new file mode 100644 index 00000000000..0446836ba5c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_operations.py @@ -0,0 +1,362 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import DatetimeClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_header_default_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/datetime/header/default" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "rfc-1123") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_rfc3339_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/datetime/header/rfc3339" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "iso-8601") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_rfc7231_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/datetime/header/rfc7231" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "rfc-1123") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_unix_timestamp_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/datetime/header/unix-timestamp" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "unix-time") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_unix_timestamp_array_request( # pylint: disable=name-too-long + *, value: List[datetime.datetime], **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/datetime/header/unix-timestamp-array" + + # Construct headers + _headers["value"] = _SERIALIZER.header("value", value, "[unix-time]", div=",") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.DatetimeClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """default. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def rfc3339( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """rfc3339. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_rfc3339_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def rfc7231( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """rfc7231. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_rfc7231_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def unix_timestamp( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """unix_timestamp. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_unix_timestamp_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def unix_timestamp_array( # pylint: disable=inconsistent-return-statements + self, *, value: List[datetime.datetime], **kwargs: Any + ) -> None: + """unix_timestamp_array. + + :keyword value: Required. + :paramtype value: list[~datetime.datetime] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_unix_timestamp_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/header/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/__init__.py deleted file mode 100644 index d28aab0d0c1..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore -from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore -from ._operations import ResponseHeaderOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", - "PropertyOperations", - "HeaderOperations", - "ResponseHeaderOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py deleted file mode 100644 index 3d36cf24872..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py +++ /dev/null @@ -1,1630 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import datetime -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from .._configuration import DatetimeClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_query_default_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/datetime/query/default" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "iso-8601") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_rfc3339_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/datetime/query/rfc3339" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "iso-8601") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_rfc7231_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/datetime/query/rfc7231" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "rfc-1123") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_unix_timestamp_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/datetime/query/unix-timestamp" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "unix-time") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_unix_timestamp_array_request(*, value: List[datetime.datetime], **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/datetime/query/unix-timestamp-array" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "[unix-time]", div=",") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_property_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/datetime/property/default" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_rfc3339_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/datetime/property/rfc3339" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_rfc7231_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/datetime/property/rfc7231" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_unix_timestamp_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/datetime/property/unix-timestamp" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_unix_timestamp_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/datetime/property/unix-timestamp-array" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_header_default_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/datetime/header/default" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "rfc-1123") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_rfc3339_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/datetime/header/rfc3339" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "iso-8601") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_rfc7231_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/datetime/header/rfc7231" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "rfc-1123") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_unix_timestamp_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/datetime/header/unix-timestamp" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "unix-time") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_unix_timestamp_array_request( # pylint: disable=name-too-long - *, value: List[datetime.datetime], **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/datetime/header/unix-timestamp-array" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "[unix-time]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_header_default_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/encode/datetime/responseheader/default" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_response_header_rfc3339_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/encode/datetime/responseheader/rfc3339" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_response_header_rfc7231_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/encode/datetime/responseheader/rfc7231" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_response_header_unix_timestamp_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - # Construct URL - _url = "/encode/datetime/responseheader/unix-timestamp" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.DatetimeClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """default. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def rfc3339( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """rfc3339. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_rfc3339_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def rfc7231( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """rfc7231. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_rfc7231_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def unix_timestamp( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """unix_timestamp. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_unix_timestamp_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def unix_timestamp_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[datetime.datetime], **kwargs: Any - ) -> None: - """unix_timestamp_array. - - :keyword value: Required. - :paramtype value: list[~datetime.datetime] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_unix_timestamp_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PropertyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.DatetimeClient`'s - :attr:`property` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def default( - self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: - """default. - - :param body: Required. - :type body: ~encode.datetime.models.DefaultDatetimeProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.DefaultDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: - """default. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.DefaultDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: - """default. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.DefaultDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def default( - self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDatetimeProperty: - """default. - - :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. - :type body: ~encode.datetime.models.DefaultDatetimeProperty or JSON or IO[bytes] - :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.DefaultDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def rfc3339( - self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: - """rfc3339. - - :param body: Required. - :type body: ~encode.datetime.models.Rfc3339DatetimeProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def rfc3339( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: - """rfc3339. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def rfc3339( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: - """rfc3339. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def rfc3339( - self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: - """rfc3339. - - :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. - :type body: ~encode.datetime.models.Rfc3339DatetimeProperty or JSON or IO[bytes] - :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_rfc3339_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def rfc7231( - self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: - """rfc7231. - - :param body: Required. - :type body: ~encode.datetime.models.Rfc7231DatetimeProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def rfc7231( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: - """rfc7231. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def rfc7231( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: - """rfc7231. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def rfc7231( - self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: - """rfc7231. - - :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. - :type body: ~encode.datetime.models.Rfc7231DatetimeProperty or JSON or IO[bytes] - :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping - :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_rfc7231_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def unix_timestamp( - self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: - """unix_timestamp. - - :param body: Required. - :type body: ~encode.datetime.models.UnixTimestampDatetimeProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with - MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def unix_timestamp( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: - """unix_timestamp. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with - MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def unix_timestamp( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: - """unix_timestamp. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with - MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def unix_timestamp( - self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: - """unix_timestamp. - - :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] - Required. - :type body: ~encode.datetime.models.UnixTimestampDatetimeProperty or JSON or IO[bytes] - :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with - MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_unix_timestamp_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def unix_timestamp_array( - self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: - """unix_timestamp_array. - - :param body: Required. - :type body: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is - compatible with MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def unix_timestamp_array( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: - """unix_timestamp_array. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is - compatible with MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def unix_timestamp_array( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: - """unix_timestamp_array. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is - compatible with MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def unix_timestamp_array( - self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: - """unix_timestamp_array. - - :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] - Required. - :type body: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty or JSON or IO[bytes] - :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is - compatible with MutableMapping - :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_unix_timestamp_array_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.DatetimeClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """default. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def rfc3339( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """rfc3339. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_rfc3339_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def rfc7231( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """rfc7231. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_rfc7231_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def unix_timestamp( # pylint: disable=inconsistent-return-statements - self, *, value: datetime.datetime, **kwargs: Any - ) -> None: - """unix_timestamp. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_unix_timestamp_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def unix_timestamp_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[datetime.datetime], **kwargs: Any - ) -> None: - """unix_timestamp_array. - - :keyword value: Required. - :paramtype value: list[~datetime.datetime] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_unix_timestamp_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseHeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.DatetimeClient`'s - :attr:`response_header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """rfc3339. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_rfc3339_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("iso-8601", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """rfc7231. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_rfc7231_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """unix_timestamp. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_unix_timestamp_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("unix-time", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py similarity index 50% rename from packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py index 8516bc107eb..68be3c22a6b 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -28,292 +26,25 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from .... import models as _models +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DatetimeClientConfiguration from ...operations._operations import ( - build_header_default_request, - build_header_rfc3339_request, - build_header_rfc7231_request, - build_header_unix_timestamp_array_request, - build_header_unix_timestamp_request, build_property_default_request, build_property_rfc3339_request, build_property_rfc7231_request, build_property_unix_timestamp_array_request, build_property_unix_timestamp_request, - build_query_default_request, - build_query_rfc3339_request, - build_query_rfc7231_request, - build_query_unix_timestamp_array_request, - build_query_unix_timestamp_request, - build_response_header_default_request, - build_response_header_rfc3339_request, - build_response_header_rfc7231_request, - build_response_header_unix_timestamp_request, ) -from .._configuration import DatetimeClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.aio.DatetimeClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def rfc3339(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """rfc3339. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_rfc3339_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def rfc7231(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """rfc7231. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_rfc7231_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def unix_timestamp(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """unix_timestamp. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_unix_timestamp_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def unix_timestamp_array(self, *, value: List[datetime.datetime], **kwargs: Any) -> None: - """unix_timestamp_array. - - :keyword value: Required. - :paramtype value: list[~datetime.datetime] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_unix_timestamp_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore class PropertyOperations: @@ -932,462 +663,3 @@ async def unix_timestamp_array( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.aio.DatetimeClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def rfc3339(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """rfc3339. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_rfc3339_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def rfc7231(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """rfc7231. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_rfc7231_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def unix_timestamp(self, *, value: datetime.datetime, **kwargs: Any) -> None: - """unix_timestamp. - - :keyword value: Required. - :paramtype value: ~datetime.datetime - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_unix_timestamp_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def unix_timestamp_array(self, *, value: List[datetime.datetime], **kwargs: Any) -> None: - """unix_timestamp_array. - - :keyword value: Required. - :paramtype value: list[~datetime.datetime] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_unix_timestamp_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseHeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.datetime.aio.DatetimeClient`'s - :attr:`response_header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, **kwargs: Any) -> None: - """default. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def rfc3339(self, **kwargs: Any) -> None: - """rfc3339. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_rfc3339_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("iso-8601", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def rfc7231(self, **kwargs: Any) -> None: - """rfc7231. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_rfc7231_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def unix_timestamp(self, **kwargs: Any) -> None: - """unix_timestamp. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_response_header_unix_timestamp_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["value"] = self._deserialize("unix-time", response.headers.get("value")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/special-words/specialwords/models/_patch.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py new file mode 100644 index 00000000000..24fecdf59b1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py @@ -0,0 +1,746 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._configuration import DatetimeClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_property_default_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/datetime/property/default" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_rfc3339_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/datetime/property/rfc3339" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_rfc7231_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/datetime/property/rfc7231" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_unix_timestamp_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/datetime/property/unix-timestamp" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_unix_timestamp_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/datetime/property/unix-timestamp-array" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class PropertyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.DatetimeClient`'s + :attr:`property` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def default( + self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDatetimeProperty: + """default. + + :param body: Required. + :type body: ~encode.datetime.models.DefaultDatetimeProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.DefaultDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def default( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDatetimeProperty: + """default. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.DefaultDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def default( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDatetimeProperty: + """default. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.DefaultDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def default( + self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultDatetimeProperty: + """default. + + :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. + :type body: ~encode.datetime.models.DefaultDatetimeProperty or JSON or IO[bytes] + :return: DefaultDatetimeProperty. The DefaultDatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.DefaultDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_default_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def rfc3339( + self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: + """rfc3339. + + :param body: Required. + :type body: ~encode.datetime.models.Rfc3339DatetimeProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rfc3339( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: + """rfc3339. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rfc3339( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: + """rfc3339. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def rfc3339( + self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: + """rfc3339. + + :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. + :type body: ~encode.datetime.models.Rfc3339DatetimeProperty or JSON or IO[bytes] + :return: Rfc3339DatetimeProperty. The Rfc3339DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc3339DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_rfc3339_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def rfc7231( + self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: + """rfc7231. + + :param body: Required. + :type body: ~encode.datetime.models.Rfc7231DatetimeProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rfc7231( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: + """rfc7231. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rfc7231( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: + """rfc7231. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def rfc7231( + self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: + """rfc7231. + + :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. + :type body: ~encode.datetime.models.Rfc7231DatetimeProperty or JSON or IO[bytes] + :return: Rfc7231DatetimeProperty. The Rfc7231DatetimeProperty is compatible with MutableMapping + :rtype: ~encode.datetime.models.Rfc7231DatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_rfc7231_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def unix_timestamp( + self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: + """unix_timestamp. + + :param body: Required. + :type body: ~encode.datetime.models.UnixTimestampDatetimeProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with + MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def unix_timestamp( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: + """unix_timestamp. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with + MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def unix_timestamp( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: + """unix_timestamp. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with + MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def unix_timestamp( + self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: + """unix_timestamp. + + :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] + Required. + :type body: ~encode.datetime.models.UnixTimestampDatetimeProperty or JSON or IO[bytes] + :return: UnixTimestampDatetimeProperty. The UnixTimestampDatetimeProperty is compatible with + MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_unix_timestamp_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def unix_timestamp_array( + self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: + """unix_timestamp_array. + + :param body: Required. + :type body: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is + compatible with MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def unix_timestamp_array( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: + """unix_timestamp_array. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is + compatible with MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def unix_timestamp_array( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: + """unix_timestamp_array. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is + compatible with MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def unix_timestamp_array( + self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: + """unix_timestamp_array. + + :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] + Required. + :type body: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty or JSON or IO[bytes] + :return: UnixTimestampArrayDatetimeProperty. The UnixTimestampArrayDatetimeProperty is + compatible with MutableMapping + :rtype: ~encode.datetime.models.UnixTimestampArrayDatetimeProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_unix_timestamp_array_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_operations.py new file mode 100644 index 00000000000..8481975ad8a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_operations.py @@ -0,0 +1,293 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DatetimeClientConfiguration +from ...operations._operations import ( + build_query_default_request, + build_query_rfc3339_request, + build_query_rfc7231_request, + build_query_unix_timestamp_array_request, + build_query_unix_timestamp_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.aio.DatetimeClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """default. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def rfc3339(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """rfc3339. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_rfc3339_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def rfc7231(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """rfc7231. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_rfc7231_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def unix_timestamp(self, *, value: datetime.datetime, **kwargs: Any) -> None: + """unix_timestamp. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_unix_timestamp_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def unix_timestamp_array(self, *, value: List[datetime.datetime], **kwargs: Any) -> None: + """unix_timestamp_array. + + :keyword value: Required. + :paramtype value: list[~datetime.datetime] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_unix_timestamp_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_operations.py new file mode 100644 index 00000000000..1a75883e516 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_operations.py @@ -0,0 +1,360 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import DatetimeClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_default_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/datetime/query/default" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "iso-8601") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_rfc3339_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/datetime/query/rfc3339" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "iso-8601") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_rfc7231_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/datetime/query/rfc7231" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "rfc-1123") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_unix_timestamp_request(*, value: datetime.datetime, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/datetime/query/unix-timestamp" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "unix-time") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_unix_timestamp_array_request(*, value: List[datetime.datetime], **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/datetime/query/unix-timestamp-array" + + # Construct parameters + _params["value"] = _SERIALIZER.query("value", value, "[unix-time]", div=",") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.DatetimeClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """default. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def rfc3339( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """rfc3339. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_rfc3339_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def rfc7231( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """rfc7231. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_rfc7231_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def unix_timestamp( # pylint: disable=inconsistent-return-statements + self, *, value: datetime.datetime, **kwargs: Any + ) -> None: + """unix_timestamp. + + :keyword value: Required. + :paramtype value: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_unix_timestamp_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def unix_timestamp_array( # pylint: disable=inconsistent-return-statements + self, *, value: List[datetime.datetime], **kwargs: Any + ) -> None: + """unix_timestamp_array. + + :keyword value: Required. + :paramtype value: list[~datetime.datetime] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_unix_timestamp_array_request( + value=value, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/query/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/__init__.py new file mode 100644 index 00000000000..dba58a39389 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResponseHeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResponseHeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_operations.py new file mode 100644 index 00000000000..2001a749820 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_operations.py @@ -0,0 +1,244 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DatetimeClientConfiguration +from ...operations._operations import ( + build_response_header_default_request, + build_response_header_rfc3339_request, + build_response_header_rfc7231_request, + build_response_header_unix_timestamp_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResponseHeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.aio.DatetimeClient`'s + :attr:`response_header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, **kwargs: Any) -> None: + """default. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_default_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def rfc3339(self, **kwargs: Any) -> None: + """rfc3339. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_rfc3339_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("iso-8601", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def rfc7231(self, **kwargs: Any) -> None: + """rfc7231. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_rfc7231_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def unix_timestamp(self, **kwargs: Any) -> None: + """unix_timestamp. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_unix_timestamp_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("unix-time", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/__init__.py new file mode 100644 index 00000000000..dba58a39389 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResponseHeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResponseHeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_operations.py new file mode 100644 index 00000000000..7eaa9c7e1b9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_operations.py @@ -0,0 +1,269 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ..._configuration import DatetimeClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_response_header_default_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/encode/datetime/responseheader/default" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_response_header_rfc3339_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/encode/datetime/responseheader/rfc3339" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_response_header_rfc7231_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/encode/datetime/responseheader/rfc7231" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_response_header_unix_timestamp_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + # Construct URL + _url = "/encode/datetime/responseheader/unix-timestamp" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class ResponseHeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.datetime.DatetimeClient`'s + :attr:`response_header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DatetimeClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """default. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_default_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """rfc3339. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_rfc3339_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("iso-8601", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """rfc7231. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_rfc7231_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("rfc-1123", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """unix_timestamp. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_response_header_unix_timestamp_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["value"] = self._deserialize("unix-time", response.headers.get("value")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/responseheader/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/setup.py b/packages/typespec-python/test/azure/generated/encode-datetime/setup.py index cc126a71be3..9ee61830559 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-datetime" +PACKAGE_NAMESPACE = "encode.datetime" PACKAGE_PPRINT_NAME = "Encode Datetime" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/MANIFEST.in b/packages/typespec-python/test/azure/generated/encode-duration/MANIFEST.in index 62dea304f68..3979592823a 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/encode-duration/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/duration/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/README.md b/packages/typespec-python/test/azure/generated/encode-duration/README.md index cf6a016066c..44530ab6f3d 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/README.md +++ b/packages/typespec-python/test/azure/generated/encode-duration/README.md @@ -1,5 +1,3 @@ - - # Encode Duration client library for Python @@ -17,6 +15,7 @@ python -m pip install encode-duration - You need an [Azure subscription][azure_sub] to use this package. - An existing Encode Duration instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json b/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json index 0d62c4e2e33..8f6082f2de0 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json @@ -1,12 +1,12 @@ { "CrossLanguagePackageId": "Encode.Duration", "CrossLanguageDefinitionId": { - "encode.duration.models.DefaultDurationProperty": "Encode.Duration.Property.DefaultDurationProperty", - "encode.duration.models.Float64SecondsDurationProperty": "Encode.Duration.Property.Float64SecondsDurationProperty", - "encode.duration.models.FloatSecondsDurationArrayProperty": "Encode.Duration.Property.FloatSecondsDurationArrayProperty", - "encode.duration.models.FloatSecondsDurationProperty": "Encode.Duration.Property.FloatSecondsDurationProperty", - "encode.duration.models.Int32SecondsDurationProperty": "Encode.Duration.Property.Int32SecondsDurationProperty", - "encode.duration.models.ISO8601DurationProperty": "Encode.Duration.Property.ISO8601DurationProperty", + "encode.duration.property.models.DefaultDurationProperty": "Encode.Duration.Property.DefaultDurationProperty", + "encode.duration.property.models.Float64SecondsDurationProperty": "Encode.Duration.Property.Float64SecondsDurationProperty", + "encode.duration.property.models.FloatSecondsDurationArrayProperty": "Encode.Duration.Property.FloatSecondsDurationArrayProperty", + "encode.duration.property.models.FloatSecondsDurationProperty": "Encode.Duration.Property.FloatSecondsDurationProperty", + "encode.duration.property.models.Int32SecondsDurationProperty": "Encode.Duration.Property.Int32SecondsDurationProperty", + "encode.duration.property.models.ISO8601DurationProperty": "Encode.Duration.Property.ISO8601DurationProperty", "encode.duration.DurationClient.query.default": "Encode.Duration.Query.default", "encode.duration.DurationClient.query.iso8601": "Encode.Duration.Query.iso8601", "encode.duration.DurationClient.query.int32_seconds": "Encode.Duration.Query.int32Seconds", diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py index 5250920b20b..8fa1c00a3fb 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py @@ -16,7 +16,9 @@ from ._configuration import DurationClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import HeaderOperations, PropertyOperations, QueryOperations +from .header.operations import HeaderOperations +from .property.operations import PropertyOperations +from .query.operations import QueryOperations class DurationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py index 4f9fcff8eda..bdd7f4df106 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py @@ -15,8 +15,10 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..header.aio.operations import HeaderOperations +from ..property.aio.operations import PropertyOperations +from ..query.aio.operations import QueryOperations from ._configuration import DurationClientConfiguration -from .operations import HeaderOperations, PropertyOperations, QueryOperations class DurationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py new file mode 100644 index 00000000000..9766153c063 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DurationClientConfiguration +from ...operations._operations import ( + build_header_default_request, + build_header_float64_seconds_request, + build_header_float_seconds_request, + build_header_int32_seconds_request, + build_header_iso8601_array_request, + build_header_iso8601_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.aio.DurationClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: + """default. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: + """iso8601. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601_array(self, *, duration: List[datetime.timedelta], **kwargs: Any) -> None: + """iso8601_array. + + :keyword duration: Required. + :paramtype duration: list[~datetime.timedelta] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_array_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: + """int32_seconds. + + :keyword duration: Required. + :paramtype duration: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_int32_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float_seconds(self, *, duration: float, **kwargs: Any) -> None: + """float_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float64_seconds(self, *, duration: float, **kwargs: Any) -> None: + """float64_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float64_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py new file mode 100644 index 00000000000..fa142366b7d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py @@ -0,0 +1,419 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import DurationClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_header_default_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/default" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_iso8601_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/iso8601" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_iso8601_array_request(*, duration: List[datetime.timedelta], **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/iso8601-array" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "[duration]", div=",") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_int32_seconds_request(*, duration: int, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/int32-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "int") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_float_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/float-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "float") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_float64_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/float64-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "float") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.DurationClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, duration: datetime.timedelta, **kwargs: Any + ) -> None: + """default. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601( # pylint: disable=inconsistent-return-statements + self, *, duration: datetime.timedelta, **kwargs: Any + ) -> None: + """iso8601. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601_array( # pylint: disable=inconsistent-return-statements + self, *, duration: List[datetime.timedelta], **kwargs: Any + ) -> None: + """iso8601_array. + + :keyword duration: Required. + :paramtype duration: list[~datetime.timedelta] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_array_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """int32_seconds. + + :keyword duration: Required. + :paramtype duration: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_int32_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float_seconds( # pylint: disable=inconsistent-return-statements + self, *, duration: float, **kwargs: Any + ) -> None: + """float_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float64_seconds( # pylint: disable=inconsistent-return-statements + self, *, duration: float, **kwargs: Any + ) -> None: + """float64_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float64_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/__init__.py similarity index 85% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/__init__.py index 543a6758629..22f11074013 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/__init__.py @@ -12,18 +12,14 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import QueryOperations # type: ignore from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryOperations", "PropertyOperations", - "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py index ebd6dcb3fa8..efe6de82e88 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -29,337 +27,25 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DurationClientConfiguration from ...operations._operations import ( - build_header_default_request, - build_header_float64_seconds_request, - build_header_float_seconds_request, - build_header_int32_seconds_request, - build_header_iso8601_array_request, - build_header_iso8601_request, build_property_default_request, build_property_float64_seconds_request, build_property_float_seconds_array_request, build_property_float_seconds_request, build_property_int32_seconds_request, build_property_iso8601_request, - build_query_default_request, - build_query_float64_seconds_request, - build_query_float_seconds_request, - build_query_int32_seconds_array_request, - build_query_int32_seconds_request, - build_query_iso8601_request, ) -from .._configuration import DurationClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.aio.DurationClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, input: datetime.timedelta, **kwargs: Any) -> None: - """default. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601(self, *, input: datetime.timedelta, **kwargs: Any) -> None: - """iso8601. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_iso8601_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds(self, *, input: int, **kwargs: Any) -> None: - """int32_seconds. - - :keyword input: Required. - :paramtype input: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float_seconds(self, *, input: float, **kwargs: Any) -> None: - """float_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float64_seconds(self, *, input: float, **kwargs: Any) -> None: - """float64_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float64_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds_array(self, *, input: List[int], **kwargs: Any) -> None: - """int32_seconds_array. - - :keyword input: Required. - :paramtype input: list[int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_array_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore class PropertyOperations: @@ -1106,303 +792,3 @@ async def float_seconds_array( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.aio.DurationClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: - """default. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: - """iso8601. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601_array(self, *, duration: List[datetime.timedelta], **kwargs: Any) -> None: - """iso8601_array. - - :keyword duration: Required. - :paramtype duration: list[~datetime.timedelta] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_array_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: - """int32_seconds. - - :keyword duration: Required. - :paramtype duration: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_int32_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float_seconds(self, *, duration: float, **kwargs: Any) -> None: - """float_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float64_seconds(self, *, duration: float, **kwargs: Any) -> None: - """float64_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float64_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py similarity index 98% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py index a55bf7e46c4..17debec1547 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py @@ -10,8 +10,8 @@ import datetime from typing import Any, List, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class DefaultDurationProperty(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/__init__.py similarity index 85% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/__init__.py index 543a6758629..22f11074013 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/__init__.py @@ -12,18 +12,14 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import QueryOperations # type: ignore from ._operations import PropertyOperations # type: ignore -from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryOperations", "PropertyOperations", - "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py index bee4d3958c5..e06695c3f36 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -29,94 +27,22 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import DurationClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import DurationClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_query_default_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/default" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "duration") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_iso8601_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/iso8601" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "duration") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_int32_seconds_request(*, input: int, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/int32-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "int") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_float_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/float-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "float") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_float64_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/float64-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "float") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_int32_seconds_array_request(*, input: List[int], **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/int32-seconds-array" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "[int]", div=",") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - def build_property_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -194,407 +120,29 @@ def build_property_float64_seconds_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/encode/duration/property/float64-seconds" - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_float_seconds_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/duration/property/float-seconds-array" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_header_default_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/default" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_iso8601_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/iso8601" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_iso8601_array_request(*, duration: List[datetime.timedelta], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/iso8601-array" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "[duration]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_int32_seconds_request(*, duration: int, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/int32-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "int") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_float_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/float-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "float") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_float64_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/float64-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "float") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.DurationClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, input: datetime.timedelta, **kwargs: Any - ) -> None: - """default. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601( # pylint: disable=inconsistent-return-statements - self, *, input: datetime.timedelta, **kwargs: Any - ) -> None: - """iso8601. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_iso8601_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """int32_seconds. - - :keyword input: Required. - :paramtype input: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """float_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float64_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """float64_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float64_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds_array( # pylint: disable=inconsistent-return-statements - self, *, input: List[int], **kwargs: Any - ) -> None: - """int32_seconds_array. - - :keyword input: Required. - :paramtype input: list[int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - cls: ClsType[None] = kwargs.pop("cls", None) + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - _request = build_query_int32_seconds_array_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) +def build_property_float_seconds_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - response = pipeline_response.http_response + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct URL + _url = "/encode/duration/property/float-seconds-array" - if cls: - return cls(pipeline_response, None, {}) # type: ignore + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) class PropertyOperations: @@ -1341,313 +889,3 @@ def float_seconds_array( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.DurationClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, duration: datetime.timedelta, **kwargs: Any - ) -> None: - """default. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601( # pylint: disable=inconsistent-return-statements - self, *, duration: datetime.timedelta, **kwargs: Any - ) -> None: - """iso8601. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601_array( # pylint: disable=inconsistent-return-statements - self, *, duration: List[datetime.timedelta], **kwargs: Any - ) -> None: - """iso8601_array. - - :keyword duration: Required. - :paramtype duration: list[~datetime.timedelta] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_array_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """int32_seconds. - - :keyword duration: Required. - :paramtype duration: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_int32_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float_seconds( # pylint: disable=inconsistent-return-statements - self, *, duration: float, **kwargs: Any - ) -> None: - """float_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float64_seconds( # pylint: disable=inconsistent-return-statements - self, *, duration: float, **kwargs: Any - ) -> None: - """float64_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float64_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py new file mode 100644 index 00000000000..f201c580435 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import DurationClientConfiguration +from ...operations._operations import ( + build_query_default_request, + build_query_float64_seconds_request, + build_query_float_seconds_request, + build_query_int32_seconds_array_request, + build_query_int32_seconds_request, + build_query_iso8601_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.aio.DurationClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, input: datetime.timedelta, **kwargs: Any) -> None: + """default. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601(self, *, input: datetime.timedelta, **kwargs: Any) -> None: + """iso8601. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_iso8601_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds(self, *, input: int, **kwargs: Any) -> None: + """int32_seconds. + + :keyword input: Required. + :paramtype input: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float_seconds(self, *, input: float, **kwargs: Any) -> None: + """float_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float64_seconds(self, *, input: float, **kwargs: Any) -> None: + """float64_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float64_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds_array(self, *, input: List[int], **kwargs: Any) -> None: + """int32_seconds_array. + + :keyword input: Required. + :paramtype input: list[int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_array_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py new file mode 100644 index 00000000000..ce253fe1865 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py @@ -0,0 +1,415 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import DurationClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_default_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/default" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "duration") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_iso8601_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/iso8601" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "duration") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_int32_seconds_request(*, input: int, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/int32-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "int") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_float_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/float-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "float") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_float64_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/float64-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "float") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_int32_seconds_array_request(*, input: List[int], **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/int32-seconds-array" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "[int]", div=",") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.DurationClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, input: datetime.timedelta, **kwargs: Any + ) -> None: + """default. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601( # pylint: disable=inconsistent-return-statements + self, *, input: datetime.timedelta, **kwargs: Any + ) -> None: + """iso8601. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_iso8601_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """int32_seconds. + + :keyword input: Required. + :paramtype input: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """float_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float64_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """float64_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float64_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds_array( # pylint: disable=inconsistent-return-statements + self, *, input: List[int], **kwargs: Any + ) -> None: + """int32_seconds_array. + + :keyword input: Required. + :paramtype input: list[int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_array_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/setup.py b/packages/typespec-python/test/azure/generated/encode-duration/setup.py index 0f5a7873f2a..d93787e3491 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-duration" +PACKAGE_NAMESPACE = "encode.duration" PACKAGE_PPRINT_NAME = "Encode Duration" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/MANIFEST.in b/packages/typespec-python/test/azure/generated/encode-numeric/MANIFEST.in index c5a0766925a..9f4baead01e 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/encode-numeric/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/numeric/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/README.md b/packages/typespec-python/test/azure/generated/encode-numeric/README.md index b38cb9bc960..2561cacf778 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/README.md +++ b/packages/typespec-python/test/azure/generated/encode-numeric/README.md @@ -1,5 +1,3 @@ - - # Encode Numeric client library for Python @@ -17,6 +15,7 @@ python -m pip install encode-numeric - You need an [Azure subscription][azure_sub] to use this package. - An existing Encode Numeric instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json b/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json index 14141434976..605460c05bb 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json @@ -1,9 +1,9 @@ { "CrossLanguagePackageId": "Encode.Numeric", "CrossLanguageDefinitionId": { - "encode.numeric.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", - "encode.numeric.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", - "encode.numeric.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty", + "encode.numeric.property.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", + "encode.numeric.property.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", + "encode.numeric.property.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty", "encode.numeric.NumericClient.property.safeint_as_string": "Encode.Numeric.Property.safeintAsString", "encode.numeric.NumericClient.property.uint32_as_string_optional": "Encode.Numeric.Property.uint32AsStringOptional", "encode.numeric.NumericClient.property.uint8_as_string": "Encode.Numeric.Property.uint8AsString" diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py index 23ea0b25ec4..a94212dc76a 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py @@ -16,7 +16,7 @@ from ._configuration import NumericClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import PropertyOperations +from .property.operations import PropertyOperations class NumericClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py index 805a5d849c2..90bfe9ada6b 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..property.aio.operations import PropertyOperations from ._configuration import NumericClientConfiguration -from .operations import PropertyOperations class NumericClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py new file mode 100644 index 00000000000..22f11074013 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PropertyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PropertyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py index 1bb072b5cc8..17e7a8b8068 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py @@ -27,14 +27,14 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import NumericClientConfiguration from ...operations._operations import ( build_property_safeint_as_string_request, build_property_uint32_as_string_optional_request, build_property_uint8_as_string_request, ) -from .._configuration import NumericClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py similarity index 97% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py index 91af13a3300..3522012d118 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, Optional, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class SafeintAsStringProperty(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py new file mode 100644 index 00000000000..22f11074013 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PropertyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PropertyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py index 0f5715ee7a0..cc46c9e81e5 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import NumericClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import NumericClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/setup.py b/packages/typespec-python/test/azure/generated/encode-numeric/setup.py index 02d7040d463..2ac09c33a86 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-numeric" +PACKAGE_NAMESPACE = "encode.numeric" PACKAGE_PPRINT_NAME = "Encode Numeric" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/MANIFEST.in b/packages/typespec-python/test/azure/generated/headasbooleanfalse/MANIFEST.in index 3a185557967..8d48e547d69 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include headasbooleanfalse/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/README.md b/packages/typespec-python/test/azure/generated/headasbooleanfalse/README.md index 8dd1d057d45..fc215bffae1 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/README.md +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/README.md @@ -1,5 +1,3 @@ - - # Headasbooleanfalse client library for Python @@ -17,6 +15,7 @@ python -m pip install headasbooleanfalse - You need an [Azure subscription][azure_sub] to use this package. - An existing Headasbooleanfalse instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py index a5d396587ff..21aea634998 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "headasbooleanfalse" +PACKAGE_NAMESPACE = "headasbooleanfalse" PACKAGE_PPRINT_NAME = "Headasbooleanfalse" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/MANIFEST.in b/packages/typespec-python/test/azure/generated/headasbooleantrue/MANIFEST.in index 89f2c0dccd2..d79293c6f31 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include headasbooleantrue/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/README.md b/packages/typespec-python/test/azure/generated/headasbooleantrue/README.md index aa1d5599373..2ee76657dae 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/README.md +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/README.md @@ -1,5 +1,3 @@ - - # Headasbooleantrue client library for Python @@ -17,6 +15,7 @@ python -m pip install headasbooleantrue - You need an [Azure subscription][azure_sub] to use this package. - An existing Headasbooleantrue instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py index e7c30f07752..5282005e691 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "headasbooleantrue" +PACKAGE_NAMESPACE = "headasbooleantrue" PACKAGE_PPRINT_NAME = "Headasbooleantrue" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/MANIFEST.in b/packages/typespec-python/test/azure/generated/parameters-basic/MANIFEST.in index 18f9767aa78..ec6eea5b987 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/parameters-basic/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/basic/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/README.md b/packages/typespec-python/test/azure/generated/parameters-basic/README.md index e2f7a58da85..d4b2e17c7c4 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/README.md +++ b/packages/typespec-python/test/azure/generated/parameters-basic/README.md @@ -1,5 +1,3 @@ - - # Parameters Basic client library for Python @@ -17,6 +15,7 @@ python -m pip install parameters-basic - You need an [Azure subscription][azure_sub] to use this package. - An existing Parameters Basic instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json b/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json index 3f5d96dd1ca..84689902892 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Parameters.Basic", "CrossLanguageDefinitionId": { - "parameters.basic.models.User": "Parameters.Basic.ExplicitBody.User", + "parameters.basic.explicitbody.models.User": "Parameters.Basic.ExplicitBody.User", "parameters.basic.BasicClient.explicit_body.simple": "Parameters.Basic.ExplicitBody.simple", "parameters.basic.BasicClient.implicit_body.simple": "Parameters.Basic.ImplicitBody.simple" } diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py index 76c418fd795..ec80a50fd3e 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py @@ -16,7 +16,8 @@ from ._configuration import BasicClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ExplicitBodyOperations, ImplicitBodyOperations +from .explicitbody.operations import ExplicitBodyOperations +from .implicitbody.operations import ImplicitBodyOperations class BasicClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py index 1a86654cf72..971d86d9688 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..explicitbody.aio.operations import ExplicitBodyOperations +from ..implicitbody.aio.operations import ImplicitBodyOperations from ._configuration import BasicClientConfiguration -from .operations import ExplicitBodyOperations, ImplicitBodyOperations class BasicClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py index e6d8ddd24ac..c70354e72dc 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py @@ -13,7 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import ExplicitBodyOperations # type: ignore -from ._operations import ImplicitBodyOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -21,7 +20,6 @@ __all__ = [ "ExplicitBodyOperations", - "ImplicitBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py new file mode 100644 index 00000000000..0c990b7501a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BasicClientConfiguration +from ...operations._operations import build_explicit_body_simple_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.aio.BasicClient`'s + :attr:`explicit_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: ~parameters.basic.models.User + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: + """simple. + + :param body: Is one of the following types: User, JSON, IO[bytes] Required. + :type body: ~parameters.basic.models.User or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_explicit_body_simple_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py index b068e5f17f7..2443804a4b4 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class User(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py index e6d8ddd24ac..c70354e72dc 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py @@ -13,7 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import ExplicitBodyOperations # type: ignore -from ._operations import ImplicitBodyOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -21,7 +20,6 @@ __all__ = [ "ExplicitBodyOperations", - "ImplicitBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py new file mode 100644 index 00000000000..31c14fda761 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import BasicClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_explicit_body_simple_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/basic/explicit-body/simple" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +class ExplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.BasicClient`'s + :attr:`explicit_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: ~parameters.basic.models.User + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def simple( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """simple. + + :param body: Is one of the following types: User, JSON, IO[bytes] Required. + :type body: ~parameters.basic.models.User or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_explicit_body_simple_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py new file mode 100644 index 00000000000..5fcf24c10f3 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ImplicitBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ImplicitBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py new file mode 100644 index 00000000000..b366bffd3af --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BasicClientConfiguration +from ...operations._operations import build_implicit_body_simple_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ImplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.aio.BasicClient`'s + :attr:`implicit_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any) -> None: + """simple. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_implicit_body_simple_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py new file mode 100644 index 00000000000..5fcf24c10f3 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ImplicitBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ImplicitBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py new file mode 100644 index 00000000000..9de19134ec7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import BasicClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_implicit_body_simple_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/basic/implicit-body/simple" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +class ImplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.BasicClient`'s + :attr:`implicit_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def simple( # pylint: disable=inconsistent-return-statements + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """simple. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_implicit_body_simple_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/setup.py b/packages/typespec-python/test/azure/generated/parameters-basic/setup.py index de08f6cdecb..c00286f9747 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-basic" +PACKAGE_NAMESPACE = "parameters.basic" PACKAGE_PPRINT_NAME = "Parameters Basic" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/MANIFEST.in b/packages/typespec-python/test/azure/generated/parameters-body-optionality/MANIFEST.in index 0d45a014ef2..2dad293a4dc 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/bodyoptionality/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/README.md b/packages/typespec-python/test/azure/generated/parameters-body-optionality/README.md index c46b31a56b4..01040bbca9b 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/README.md +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/README.md @@ -1,5 +1,3 @@ - - # Parameters Bodyoptionality client library for Python @@ -17,6 +15,7 @@ python -m pip install parameters-bodyoptionality - You need an [Azure subscription][azure_sub] to use this package. - An existing Parameters Bodyoptionality instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_client.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_client.py index 3f3adb27c9c..89c3d462d4c 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import HttpRequest, HttpResponse from ._configuration import BodyOptionalityClientConfiguration +from ._operations import BodyOptionalityClientOperationsMixin from ._serialization import Deserializer, Serializer -from .operations import BodyOptionalityClientOperationsMixin, OptionalExplicitOperations +from .optionalexplicit.operations import OptionalExplicitOperations class BodyOptionalityClient(BodyOptionalityClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/__init__.py index e2c85131ec7..23fda0916ce 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import OptionalExplicitOperations # type: ignore from ._operations import BodyOptionalityClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "OptionalExplicitOperations", "BodyOptionalityClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py new file mode 100644 index 00000000000..33530324be9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py @@ -0,0 +1,281 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from .._model_base import SdkJSONEncoder +from .._serialization import Serializer +from .._vendor import BodyOptionalityClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_body_optionality_required_explicit_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/body-optionality/required-explicit" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_body_optionality_required_implicit_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/body-optionality/required-implicit" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): + + @overload + def required_explicit( + self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """required_explicit. + + :param body: Required. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_explicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_explicit. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_explicit(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_explicit. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def required_explicit( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """required_explicit. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_body_optionality_required_explicit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def required_implicit(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """required_implicit. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_implicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_implicit. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_implicit(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_implicit. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def required_implicit( # pylint: disable=inconsistent-return-statements + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """required_implicit. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_body_optionality_required_implicit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_client.py index 9ce07013b5f..0dcc3936e44 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..optionalexplicit.aio.operations import OptionalExplicitOperations from ._configuration import BodyOptionalityClientConfiguration -from .operations import BodyOptionalityClientOperationsMixin, OptionalExplicitOperations +from ._operations import BodyOptionalityClientOperationsMixin class BodyOptionalityClient(BodyOptionalityClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/__init__.py index e2c85131ec7..23fda0916ce 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import OptionalExplicitOperations # type: ignore from ._operations import BodyOptionalityClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "OptionalExplicitOperations", "BodyOptionalityClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py new file mode 100644 index 00000000000..4db2518d47a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py @@ -0,0 +1,256 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._model_base import SdkJSONEncoder +from ..._operations._operations import ( + build_body_optionality_required_explicit_request, + build_body_optionality_required_implicit_request, +) +from .._vendor import BodyOptionalityClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): + + @overload + async def required_explicit( + self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """required_explicit. + + :param body: Required. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_explicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_explicit. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_explicit( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """required_explicit. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """required_explicit. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_body_optionality_required_explicit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def required_implicit(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """required_implicit. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_implicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """required_implicit. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_implicit( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """required_implicit. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def required_implicit( + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """required_implicit. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_body_optionality_required_implicit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/__init__.py new file mode 100644 index 00000000000..83a10b55fe3 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import OptionalExplicitOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "OptionalExplicitOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py new file mode 100644 index 00000000000..301d6d6bfb8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py @@ -0,0 +1,267 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from .... import models as _models +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import BodyOptionalityClientConfiguration +from ...operations._operations import build_optional_explicit_omit_request, build_optional_explicit_set_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OptionalExplicitOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.bodyoptionality.aio.BodyOptionalityClient`'s + :attr:`optional_explicit` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BodyOptionalityClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def set( + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """set. + + :param body: Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def set(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """set. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def set( + self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """set. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + """set. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_optional_explicit_set_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def omit( + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """omit. + + :param body: Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def omit(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """omit. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def omit( + self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """omit. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + """omit. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_optional_explicit_omit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/__init__.py new file mode 100644 index 00000000000..83a10b55fe3 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import OptionalExplicitOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "OptionalExplicitOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py new file mode 100644 index 00000000000..dc8ff3c3b75 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py @@ -0,0 +1,297 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._configuration import BodyOptionalityClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_optional_explicit_set_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/body-optionality/optional-explicit/set" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_optional_explicit_omit_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/body-optionality/optional-explicit/omit" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class OptionalExplicitOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.bodyoptionality.BodyOptionalityClient`'s + :attr:`optional_explicit` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BodyOptionalityClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def set( + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """set. + + :param body: Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def set(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """set. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """set. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def set( # pylint: disable=inconsistent-return-statements + self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + ) -> None: + """set. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_optional_explicit_set_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def omit( + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """omit. + + :param body: Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def omit(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """omit. + + :param body: Default value is None. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: + """omit. + + :param body: Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def omit( # pylint: disable=inconsistent-return-statements + self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + ) -> None: + """omit. + + :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. + :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_optional_explicit_omit_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py index 0ea19d4f766..25fc0d23b09 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-bodyoptionality" +PACKAGE_NAMESPACE = "parameters.bodyoptionality" PACKAGE_PPRINT_NAME = "Parameters Bodyoptionality" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/MANIFEST.in b/packages/typespec-python/test/azure/generated/parameters-collection-format/MANIFEST.in index 90d0ba2db1f..e4e65c4a1d5 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/collectionformat/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/README.md b/packages/typespec-python/test/azure/generated/parameters-collection-format/README.md index d094692432e..cc2e770e018 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/README.md +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/README.md @@ -1,5 +1,3 @@ - - # Parameters Collectionformat client library for Python @@ -17,6 +15,7 @@ python -m pip install parameters-collectionformat - You need an [Azure subscription][azure_sub] to use this package. - An existing Parameters Collectionformat instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/_client.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/_client.py index d78764a0ca5..e729f304369 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/_client.py @@ -16,7 +16,8 @@ from ._configuration import CollectionFormatClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import HeaderOperations, QueryOperations +from .header.operations import HeaderOperations +from .query.operations import QueryOperations class CollectionFormatClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/_client.py index 436da0e76b5..80e29e9097b 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..header.aio.operations import HeaderOperations +from ..query.aio.operations import QueryOperations from ._configuration import CollectionFormatClientConfiguration -from .operations import HeaderOperations, QueryOperations class CollectionFormatClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_operations.py new file mode 100644 index 00000000000..b70837bb6f6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_operations.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import CollectionFormatClientConfiguration +from ...operations._operations import build_header_csv_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.collectionformat.aio.CollectionFormatClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CollectionFormatClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def csv(self, *, colors: List[str], **kwargs: Any) -> None: + """csv. + + :keyword colors: Possible values for colors are [blue,red,green]. Required. + :paramtype colors: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_csv_request( + colors=colors, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/__init__.py new file mode 100644 index 00000000000..1ab30f60268 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import HeaderOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HeaderOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_operations.py new file mode 100644 index 00000000000..223ec858a67 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import CollectionFormatClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_header_csv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/parameters/collection-format/header/csv" + + # Construct headers + _headers["colors"] = _SERIALIZER.header("colors", colors, "[str]", div=",") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.collectionformat.CollectionFormatClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CollectionFormatClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """csv. + + :keyword colors: Possible values for colors are [blue,red,green]. Required. + :paramtype colors: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_csv_request( + colors=colors, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/header/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_operations.py similarity index 80% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_operations.py index 892a6a4dacd..fb5b404d41e 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_operations.py @@ -21,16 +21,15 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ..._serialization import Deserializer, Serializer +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import CollectionFormatClientConfiguration from ...operations._operations import ( - build_header_csv_request, build_query_csv_request, build_query_multi_request, build_query_pipes_request, build_query_ssv_request, build_query_tsv_request, ) -from .._configuration import CollectionFormatClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -291,68 +290,3 @@ async def csv(self, *, colors: List[str], **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.collectionformat.aio.CollectionFormatClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CollectionFormatClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def csv(self, *, colors: List[str], **kwargs: Any) -> None: - """csv. - - :keyword colors: Possible values for colors are [blue,red,green]. Required. - :paramtype colors: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_csv_request( - colors=colors, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/__init__.py new file mode 100644 index 00000000000..97d3de4f9b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py similarity index 80% rename from packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py index 2ee5d87e987..f25821da612 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py @@ -22,8 +22,8 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .._configuration import CollectionFormatClientConfiguration -from .._serialization import Deserializer, Serializer +from ..._configuration import CollectionFormatClientConfiguration +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -55,7 +55,7 @@ def build_query_ssv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: _url = "/parameters/collection-format/query/ssv" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=" ") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) @@ -67,7 +67,7 @@ def build_query_tsv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: _url = "/parameters/collection-format/query/tsv" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=" ") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) @@ -79,7 +79,7 @@ def build_query_pipes_request(*, colors: List[str], **kwargs: Any) -> HttpReques _url = "/parameters/collection-format/query/pipes" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div="|") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) @@ -96,18 +96,6 @@ def build_query_csv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, **kwargs) -def build_header_csv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/parameters/collection-format/header/csv" - - # Construct headers - _headers["colors"] = _SERIALIZER.header("colors", colors, "[str]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - class QueryOperations: """ .. warning:: @@ -359,68 +347,3 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.collectionformat.CollectionFormatClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CollectionFormatClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """csv. - - :keyword colors: Possible values for colors are [blue,red,green]. Required. - :paramtype colors: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_csv_request( - colors=colors, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py index 415318c0e7c..e6db6540ca8 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-collectionformat" +PACKAGE_NAMESPACE = "parameters.collectionformat" PACKAGE_PPRINT_NAME = "Parameters Collectionformat" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/MANIFEST.in b/packages/typespec-python/test/azure/generated/parameters-spread/MANIFEST.in index 1deab2a88dd..eae446dee33 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/parameters-spread/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/spread/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/README.md b/packages/typespec-python/test/azure/generated/parameters-spread/README.md index fee9766d4ec..7b257b82d8a 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/README.md +++ b/packages/typespec-python/test/azure/generated/parameters-spread/README.md @@ -1,5 +1,3 @@ - - # Parameters Spread client library for Python @@ -17,6 +15,7 @@ python -m pip install parameters-spread - You need an [Azure subscription][azure_sub] to use this package. - An existing Parameters Spread instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json b/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json index 4ba87f686fe..b55cf68f16a 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Parameters.Spread", "CrossLanguageDefinitionId": { - "parameters.spread.models.BodyParameter": "Parameters.Spread.Model.BodyParameter", + "parameters.spread.model.models.BodyParameter": "Parameters.Spread.Model.BodyParameter", "parameters.spread.SpreadClient.model.spread_as_request_body": "Parameters.Spread.Model.spreadAsRequestBody", "parameters.spread.SpreadClient.model.spread_composite_request_only_with_body": "Parameters.Spread.Model.spreadCompositeRequestOnlyWithBody", "parameters.spread.SpreadClient.model.spread_composite_request_without_body": "Parameters.Spread.Model.spreadCompositeRequestWithoutBody", diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py index a755936a900..9f3ef36e2a7 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py @@ -16,7 +16,8 @@ from ._configuration import SpreadClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import AliasOperations, ModelOperations +from .alias.operations import AliasOperations +from .model.operations import ModelOperations class SpreadClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py index 5e74caef013..a66fef5785d 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..alias.aio.operations import AliasOperations +from ..model.aio.operations import ModelOperations from ._configuration import SpreadClientConfiguration -from .operations import AliasOperations, ModelOperations class SpreadClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py index f70348837ab..2131a6a0a16 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ModelOperations # type: ignore from ._operations import AliasOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ModelOperations", "AliasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py index 8735d72abf0..440bb9a8358 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -25,22 +24,16 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import SpreadClientConfiguration from ...operations._operations import ( build_alias_spread_as_request_body_request, build_alias_spread_as_request_parameter_request, build_alias_spread_parameter_with_inner_alias_request, build_alias_spread_parameter_with_inner_model_request, build_alias_spread_with_multiple_parameters_request, - build_model_spread_as_request_body_request, - build_model_spread_composite_request_mix_request, - build_model_spread_composite_request_only_with_body_request, - build_model_spread_composite_request_request, - build_model_spread_composite_request_without_body_request, ) -from .._configuration import SpreadClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -52,552 +45,6 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.spread.aio.SpreadClient`'s - :attr:`model` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_as_request_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_as_request_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_as_request_body( - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_as_request_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_only_with_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_only_with_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request_only_with_body( - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_only_with_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def spread_composite_request_without_body(self, name: str, *, test_header: str, **kwargs: Any) -> None: - """spread_composite_request_without_body. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_spread_composite_request_without_body_request( - name=name, - test_header=test_header, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request( - self, - name: str, - body: _models.BodyParameter, - *, - test_header: str, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request( - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request_mix( - self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_mix( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_mix( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request_mix( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if prop is _Unset: - raise TypeError("missing required argument: prop") - body = {"prop": prop} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_mix_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class AliasOperations: """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py index f70348837ab..2131a6a0a16 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ModelOperations # type: ignore from ._operations import AliasOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ModelOperations", "AliasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py index 87b43ee0b46..cd72b3b07b5 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -25,10 +24,9 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models -from .._configuration import SpreadClientConfiguration -from .._model_base import SdkJSONEncoder -from .._serialization import Deserializer, Serializer +from ..._configuration import SpreadClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -43,99 +41,6 @@ _SERIALIZER.client_side_validation = False -def build_model_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/request-body" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_only_with_body_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request-only-with-body" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_without_body_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/parameters/spread/model/composite-request-without-body/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_mix_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request-mix/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - def build_alias_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -238,550 +143,6 @@ def build_alias_spread_parameter_with_inner_alias_request( # pylint: disable=na return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -class ModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.spread.SpreadClient`'s - :attr:`model` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_as_request_body(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_as_request_body(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_as_request_body( # pylint: disable=inconsistent-return-statements - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_as_request_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_only_with_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_only_with_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_only_with_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def spread_composite_request_without_body( # pylint: disable=inconsistent-return-statements - self, name: str, *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request_without_body. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_spread_composite_request_without_body_request( - name=name, - test_header=test_header, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request( - self, - name: str, - body: _models.BodyParameter, - *, - test_header: str, - content_type: str = "application/json", - **kwargs: Any, - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request_mix( - self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_mix( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_mix( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request_mix( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if prop is _Unset: - raise TypeError("missing required argument: prop") - body = {"prop": prop} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_mix_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class AliasOperations: """ .. warning:: @@ -974,7 +335,7 @@ def spread_parameter_with_inner_model( # pylint: disable=inconsistent-return-st *, x_ms_test_header: str, name: str = _Unset, - **kwargs: Any, + **kwargs: Any ) -> None: """spread_parameter_with_inner_model. @@ -1111,7 +472,7 @@ def spread_as_request_parameter( # pylint: disable=inconsistent-return-statemen *, x_ms_test_header: str, name: str = _Unset, - **kwargs: Any, + **kwargs: Any ) -> None: """spread_as_request_parameter. @@ -1191,7 +552,7 @@ def spread_with_multiple_parameters( content_type: str = "application/json", optional_int: Optional[int] = None, optional_string_list: Optional[List[str]] = None, - **kwargs: Any, + **kwargs: Any ) -> None: """spread_with_multiple_parameters. @@ -1266,7 +627,7 @@ def spread_with_multiple_parameters( # pylint: disable=inconsistent-return-stat required_int_list: List[int] = _Unset, optional_int: Optional[int] = None, optional_string_list: Optional[List[str]] = None, - **kwargs: Any, + **kwargs: Any ) -> None: """spread_with_multiple_parameters. @@ -1357,7 +718,7 @@ def spread_parameter_with_inner_alias( name: str, age: int, content_type: str = "application/json", - **kwargs: Any, + **kwargs: Any ) -> None: """spread an alias with contains another alias property as body. @@ -1426,7 +787,7 @@ def spread_parameter_with_inner_alias( # pylint: disable=inconsistent-return-st x_ms_test_header: str, name: str = _Unset, age: int = _Unset, - **kwargs: Any, + **kwargs: Any ) -> None: """spread an alias with contains another alias property as body. diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py new file mode 100644 index 00000000000..1d2e89e2ccc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py similarity index 63% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py index 0f233986f81..d9bd6035ac0 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -26,52 +25,50 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import SpreadClientConfiguration from ...operations._operations import ( - build_body_optionality_required_explicit_request, - build_body_optionality_required_implicit_request, - build_optional_explicit_omit_request, - build_optional_explicit_set_request, + build_model_spread_as_request_body_request, + build_model_spread_composite_request_mix_request, + build_model_spread_composite_request_only_with_body_request, + build_model_spread_composite_request_request, + build_model_spread_composite_request_without_body_request, ) -from .._configuration import BodyOptionalityClientConfiguration -from .._vendor import BodyOptionalityClientMixinABC if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -_Unset: Any = object() -class OptionalExplicitOperations: +class ModelOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~parameters.bodyoptionality.aio.BodyOptionalityClient`'s - :attr:`optional_explicit` attribute. + :class:`~parameters.spread.aio.SpreadClient`'s + :attr:`model` attribute. """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BodyOptionalityClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """set. + async def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. - :param body: Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword name: Required. + :paramtype name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -81,10 +78,12 @@ async def set( """ @overload - async def set(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """set. + async def spread_as_request_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_as_request_body. - :param body: Default value is None. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -95,12 +94,12 @@ async def set(self, body: Optional[JSON] = None, *, content_type: str = "applica """ @overload - async def set( - self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + async def spread_as_request_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> None: - """set. + """spread_as_request_body. - :param body: Default value is None. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -111,11 +110,15 @@ async def set( """ @distributed_trace_async - async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: - """set. + async def spread_as_request_body( + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """spread_as_request_body. - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -134,17 +137,19 @@ async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_optional_explicit_set_request( + _request = build_model_spread_as_request_body_request( content_type=content_type, content=_content, headers=_headers, @@ -170,13 +175,13 @@ async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = return cls(pipeline_response, None, {}) # type: ignore @overload - async def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + async def spread_composite_request_only_with_body( + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: - """omit. + """spread_composite_request_only_with_body. - :param body: Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -186,10 +191,12 @@ async def omit( """ @overload - async def omit(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """omit. + async def spread_composite_request_only_with_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. - :param body: Default value is None. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -200,12 +207,12 @@ async def omit(self, body: Optional[JSON] = None, *, content_type: str = "applic """ @overload - async def omit( - self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + async def spread_composite_request_only_with_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> None: - """omit. + """spread_composite_request_only_with_body. - :param body: Default value is None. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -216,11 +223,13 @@ async def omit( """ @distributed_trace_async - async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: - """omit. + async def spread_composite_request_only_with_body( + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -244,12 +253,9 @@ async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_optional_explicit_omit_request( + _request = build_model_spread_composite_request_only_with_body_request( content_type=content_type, content=_content, headers=_headers, @@ -274,17 +280,74 @@ async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = if cls: return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace_async + async def spread_composite_request_without_body(self, name: str, *, test_header: str, **kwargs: Any) -> None: + """spread_composite_request_without_body. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_model_spread_composite_request_without_body_request( + name=name, + test_header=test_header, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) -class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): + if cls: + return cls(pipeline_response, None, {}) # type: ignore @overload - async def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + async def spread_composite_request( + self, + name: str, + body: _models.BodyParameter, + *, + test_header: str, + content_type: str = "application/json", + **kwargs: Any ) -> None: - """required_explicit. + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. - :type body: ~parameters.bodyoptionality.models.BodyModel + :type body: ~parameters.spread.models.BodyParameter + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -294,11 +357,17 @@ async def required_explicit( """ @overload - async def required_explicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_explicit. + async def spread_composite_request( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -308,13 +377,17 @@ async def required_explicit(self, body: JSON, *, content_type: str = "applicatio """ @overload - async def required_explicit( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + async def spread_composite_request( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any ) -> None: - """required_explicit. + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -324,11 +397,17 @@ async def required_explicit( """ @distributed_trace_async - async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """required_explicit. - - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + async def spread_composite_request( + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -354,7 +433,9 @@ async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes] else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_body_optionality_required_explicit_request( + _request = build_model_spread_composite_request_request( + name=name, + test_header=test_header, content_type=content_type, content=_content, headers=_headers, @@ -366,7 +447,7 @@ async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes] _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -380,11 +461,17 @@ async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes] return cls(pipeline_response, None, {}) # type: ignore @overload - async def required_implicit(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """required_implicit. - - :keyword name: Required. - :paramtype name: str + async def spread_composite_request_mix( + self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -394,11 +481,17 @@ async def required_implicit(self, *, name: str, content_type: str = "application """ @overload - async def required_implicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_implicit. + async def spread_composite_request_mix( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Required. :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -408,13 +501,17 @@ async def required_implicit(self, body: JSON, *, content_type: str = "applicatio """ @overload - async def required_implicit( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + async def spread_composite_request_mix( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any ) -> None: - """required_implicit. + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Required. :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -424,15 +521,19 @@ async def required_implicit( """ @distributed_trace_async - async def required_implicit( - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + async def spread_composite_request_mix( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any ) -> None: - """required_implicit. + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -452,9 +553,9 @@ async def required_implicit( cls: ClsType[None] = kwargs.pop("cls", None) if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} + if prop is _Unset: + raise TypeError("missing required argument: prop") + body = {"prop": prop} body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None @@ -463,7 +564,9 @@ async def required_implicit( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_body_optionality_required_implicit_request( + _request = build_model_spread_composite_request_mix_request( + name=name, + test_header=test_header, content_type=content_type, content=_content, headers=_headers, @@ -475,7 +578,7 @@ async def required_implicit( _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py index bce4236681e..53c260193e2 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class BodyParameter(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py new file mode 100644 index 00000000000..1d2e89e2ccc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py similarity index 60% rename from packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py index b303047b25e..34604c246ec 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py @@ -25,105 +25,139 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import BodyOptionalityClientConfiguration -from .._model_base import SdkJSONEncoder -from .._serialization import Deserializer, Serializer -from .._vendor import BodyOptionalityClientMixinABC +from ..._configuration import SpreadClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -_Unset: Any = object() _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_optional_explicit_set_request(**kwargs: Any) -> HttpRequest: +def build_model_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/body-optionality/optional-explicit/set" + _url = "/parameters/spread/model/request-body" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_optional_explicit_omit_request(**kwargs: Any) -> HttpRequest: +def build_model_spread_composite_request_only_with_body_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/body-optionality/optional-explicit/omit" + _url = "/parameters/spread/model/composite-request-only-with-body" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_model_spread_composite_request_without_body_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/parameters/spread/model/composite-request-without-body/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_body_optionality_required_explicit_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_model_spread_composite_request_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/body-optionality/required-explicit" + _url = "/parameters/spread/model/composite-request/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_body_optionality_required_implicit_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_model_spread_composite_request_mix_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/parameters/body-optionality/required-implicit" + _url = "/parameters/spread/model/composite-request-mix/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -class OptionalExplicitOperations: +class ModelOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~parameters.bodyoptionality.BodyOptionalityClient`'s - :attr:`optional_explicit` attribute. + :class:`~parameters.spread.SpreadClient`'s + :attr:`model` attribute. """ def __init__(self, *args, **kwargs): input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BodyOptionalityClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """set. + def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. - :param body: Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel + :keyword name: Required. + :paramtype name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -133,10 +167,10 @@ def set( """ @overload - def set(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """set. + def spread_as_request_body(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. - :param body: Default value is None. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -147,10 +181,10 @@ def set(self, body: Optional[JSON] = None, *, content_type: str = "application/j """ @overload - def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """set. + def spread_as_request_body(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. - :param body: Default value is None. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -161,13 +195,15 @@ def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applicat """ @distributed_trace - def set( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + def spread_as_request_body( # pylint: disable=inconsistent-return-statements + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any ) -> None: - """set. + """spread_as_request_body. - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -186,17 +222,19 @@ def set( # pylint: disable=inconsistent-return-statements content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_optional_explicit_set_request( + _request = build_model_spread_as_request_body_request( content_type=content_type, content=_content, headers=_headers, @@ -222,13 +260,13 @@ def set( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + def spread_composite_request_only_with_body( + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: - """omit. + """spread_composite_request_only_with_body. - :param body: Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -238,10 +276,12 @@ def omit( """ @overload - def omit(self, body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """omit. + def spread_composite_request_only_with_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. - :param body: Default value is None. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -252,10 +292,12 @@ def omit(self, body: Optional[JSON] = None, *, content_type: str = "application/ """ @overload - def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any) -> None: - """omit. + def spread_composite_request_only_with_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. - :param body: Default value is None. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -266,13 +308,13 @@ def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applica """ @distributed_trace - def omit( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any ) -> None: - """omit. + """spread_composite_request_only_with_body. - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -296,12 +338,9 @@ def omit( # pylint: disable=inconsistent-return-statements if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_optional_explicit_omit_request( + _request = build_model_spread_composite_request_only_with_body_request( content_type=content_type, content=_content, headers=_headers, @@ -326,17 +365,76 @@ def omit( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace + def spread_composite_request_without_body( # pylint: disable=inconsistent-return-statements + self, name: str, *, test_header: str, **kwargs: Any + ) -> None: + """spread_composite_request_without_body. -class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_model_spread_composite_request_without_body_request( + name=name, + test_header=test_header, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore @overload - def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + def spread_composite_request( + self, + name: str, + body: _models.BodyParameter, + *, + test_header: str, + content_type: str = "application/json", + **kwargs: Any, ) -> None: - """required_explicit. + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. - :type body: ~parameters.bodyoptionality.models.BodyModel + :type body: ~parameters.spread.models.BodyParameter + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -346,11 +444,17 @@ def required_explicit( """ @overload - def required_explicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_explicit. + def spread_composite_request( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -360,11 +464,17 @@ def required_explicit(self, body: JSON, *, content_type: str = "application/json """ @overload - def required_explicit(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_explicit. + def spread_composite_request( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + :param name: Required. + :type name: str :param body: Required. :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -374,13 +484,17 @@ def required_explicit(self, body: IO[bytes], *, content_type: str = "application """ @distributed_trace - def required_explicit( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any + def spread_composite_request( # pylint: disable=inconsistent-return-statements + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any ) -> None: - """required_explicit. - - :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. - :type body: ~parameters.bodyoptionality.models.BodyModel or JSON or IO[bytes] + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -406,7 +520,9 @@ def required_explicit( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_body_optionality_required_explicit_request( + _request = build_model_spread_composite_request_request( + name=name, + test_header=test_header, content_type=content_type, content=_content, headers=_headers, @@ -432,11 +548,17 @@ def required_explicit( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def required_implicit(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """required_implicit. - - :keyword name: Required. - :paramtype name: str + def spread_composite_request_mix( + self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -446,11 +568,17 @@ def required_implicit(self, *, name: str, content_type: str = "application/json" """ @overload - def required_implicit(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_implicit. + def spread_composite_request_mix( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Required. :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -460,11 +588,17 @@ def required_implicit(self, body: JSON, *, content_type: str = "application/json """ @overload - def required_implicit(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """required_implicit. + def spread_composite_request_mix( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Required. :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -474,15 +608,19 @@ def required_implicit(self, body: IO[bytes], *, content_type: str = "application """ @distributed_trace - def required_implicit( # pylint: disable=inconsistent-return-statements - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + def spread_composite_request_mix( # pylint: disable=inconsistent-return-statements + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any ) -> None: - """required_implicit. + """spread_composite_request_mix. + :param name: Required. + :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -502,9 +640,9 @@ def required_implicit( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} + if prop is _Unset: + raise TypeError("missing required argument: prop") + body = {"prop": prop} body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None @@ -513,7 +651,9 @@ def required_implicit( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_body_optionality_required_implicit_request( + _request = build_model_spread_composite_request_mix_request( + name=name, + test_header=test_header, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/setup.py b/packages/typespec-python/test/azure/generated/parameters-spread/setup.py index f040c6b525e..e451c404faf 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-spread" +PACKAGE_NAMESPACE = "parameters.spread" PACKAGE_PPRINT_NAME = "Parameters Spread" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-content-negotiation/MANIFEST.in index dc7a7e5536d..5a3e215c4f4 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/contentnegotiation/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/README.md b/packages/typespec-python/test/azure/generated/payload-content-negotiation/README.md index 861d021514d..1779f7bb274 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/README.md +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/README.md @@ -1,5 +1,3 @@ - - # Payload Contentnegotiation client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-contentnegotiation - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Contentnegotiation instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json b/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json index 7413f1ac33a..c04d68a8994 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Payload.ContentNegotiation", "CrossLanguageDefinitionId": { - "payload.contentnegotiation.models.PngImageAsJson": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", + "payload.contentnegotiation.differentbody.models.PngImageAsJson": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", "payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_png": "Payload.ContentNegotiation.SameBody.getAvatarAsPng", "payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_jpeg": "Payload.ContentNegotiation.SameBody.getAvatarAsJpeg", "payload.contentnegotiation.ContentNegotiationClient.different_body.get_avatar_as_png": "Payload.ContentNegotiation.DifferentBody.getAvatarAsPng", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py index 1fbdbf69230..ece09d7e4aa 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py @@ -16,7 +16,8 @@ from ._configuration import ContentNegotiationClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import DifferentBodyOperations, SameBodyOperations +from .differentbody.operations import DifferentBodyOperations +from .samebody.operations import SameBodyOperations class ContentNegotiationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py index 88fb495e0c1..56c21f43cd9 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py @@ -15,8 +15,9 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..differentbody.aio.operations import DifferentBodyOperations +from ..samebody.aio.operations import SameBodyOperations from ._configuration import ContentNegotiationClientConfiguration -from .operations import DifferentBodyOperations, SameBodyOperations class ContentNegotiationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py similarity index 91% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py index 1368193a3d3..252469fdbe3 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import SameBodyOperations # type: ignore from ._operations import DifferentBodyOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "SameBodyOperations", "DifferentBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py new file mode 100644 index 00000000000..424599a5979 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import ContentNegotiationClientConfiguration +from ...operations._operations import ( + build_different_body_get_avatar_as_json_request, + build_different_body_get_avatar_as_png_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class DifferentBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s + :attr:`different_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: + """get_avatar_as_png. + + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_different_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: + """get_avatar_as_json. + + :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping + :rtype: ~payload.contentnegotiation.models.PngImageAsJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) + cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + + _request = build_different_body_get_avatar_as_json_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PngImageAsJson, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py index 872fb18c037..6a3df60df29 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class PngImageAsJson(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py similarity index 91% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py index 1368193a3d3..252469fdbe3 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import SameBodyOperations # type: ignore from ._operations import DifferentBodyOperations # type: ignore from ._patch import __all__ as _patch_all @@ -20,7 +19,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "SameBodyOperations", "DifferentBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py new file mode 100644 index 00000000000..22844d8363a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py @@ -0,0 +1,203 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import ContentNegotiationClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_different_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + # Construct URL + _url = "/content-negotiation/different-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_different_body_get_avatar_as_json_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) + # Construct URL + _url = "/content-negotiation/different-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class DifferentBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.ContentNegotiationClient`'s + :attr:`different_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: + """get_avatar_as_png. + + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_different_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: + """get_avatar_as_json. + + :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping + :rtype: ~payload.contentnegotiation.models.PngImageAsJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) + cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + + _request = build_different_body_get_avatar_as_json_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PngImageAsJson, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py new file mode 100644 index 00000000000..7254e3c3b6e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import SameBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SameBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py new file mode 100644 index 00000000000..6d65afe55c1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import ContentNegotiationClientConfiguration +from ...operations._operations import ( + build_same_body_get_avatar_as_jpeg_request, + build_same_body_get_avatar_as_png_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SameBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s + :attr:`same_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: + """get_avatar_as_png. + + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: + """get_avatar_as_jpeg. + + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_jpeg_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py new file mode 100644 index 00000000000..7254e3c3b6e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import SameBodyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SameBodyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py new file mode 100644 index 00000000000..5a07e7a2957 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py @@ -0,0 +1,198 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import ContentNegotiationClientConfiguration +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_same_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + # Construct URL + _url = "/content-negotiation/same-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_same_body_get_avatar_as_jpeg_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + # Construct URL + _url = "/content-negotiation/same-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class SameBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.ContentNegotiationClient`'s + :attr:`same_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: + """get_avatar_as_png. + + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: + """get_avatar_as_jpeg. + + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_jpeg_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py index 91c1eac7efa..3da6c9caf95 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-contentnegotiation" +PACKAGE_NAMESPACE = "payload.contentnegotiation" PACKAGE_PPRINT_NAME = "Payload Contentnegotiation" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/MANIFEST.in index a4b16dd0a5c..5294299b234 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/jsonmergepatch/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/README.md b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/README.md index 8b6658000df..46b173ee6a1 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/README.md +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/README.md @@ -1,5 +1,3 @@ - - # Payload Jsonmergepatch client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-jsonmergepatch - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Jsonmergepatch instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py index 88df3d2fc91..a63cecec63b 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-jsonmergepatch" +PACKAGE_NAMESPACE = "payload.jsonmergepatch" PACKAGE_PPRINT_NAME = "Payload Jsonmergepatch" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-media-type/MANIFEST.in index 72b1c340a64..4c10e654b7f 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-media-type/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/mediatype/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/README.md b/packages/typespec-python/test/azure/generated/payload-media-type/README.md index a45881ae204..3776cd77177 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/README.md +++ b/packages/typespec-python/test/azure/generated/payload-media-type/README.md @@ -1,5 +1,3 @@ - - # Payload Mediatype client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-mediatype - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Mediatype instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/_client.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/_client.py index f13a86816e6..93d95fcc350 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/_client.py @@ -16,7 +16,7 @@ from ._configuration import MediaTypeClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import StringBodyOperations +from .stringbody.operations import StringBodyOperations class MediaTypeClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/_client.py index ff26c34ced3..0438cdd8725 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..stringbody.aio.operations import StringBodyOperations from ._configuration import MediaTypeClientConfiguration -from .operations import StringBodyOperations class MediaTypeClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/__init__.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_operations.py index 9d774613da8..5bdf070009d 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_operations.py @@ -25,15 +25,15 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import MediaTypeClientConfiguration from ...operations._operations import ( build_string_body_get_as_json_request, build_string_body_get_as_text_request, build_string_body_send_as_json_request, build_string_body_send_as_text_request, ) -from .._configuration import MediaTypeClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_operations.py index 4d43b6ef488..e462d39a4b8 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_operations.py @@ -25,9 +25,9 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .._configuration import MediaTypeClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import MediaTypeClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/stringbody/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/setup.py b/packages/typespec-python/test/azure/generated/payload-media-type/setup.py index c72d277c79e..f72a4fc8027 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-mediatype" +PACKAGE_NAMESPACE = "payload.mediatype" PACKAGE_PPRINT_NAME = "Payload Mediatype" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-multipart/MANIFEST.in index c41546020da..022fdb3ee1f 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-multipart/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/multipart/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/README.md b/packages/typespec-python/test/azure/generated/payload-multipart/README.md index 1988da6d7e5..522ddb6785f 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/README.md +++ b/packages/typespec-python/test/azure/generated/payload-multipart/README.md @@ -1,5 +1,3 @@ - - # Payload Multipart client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-multipart - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Multipart instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json index 01e6180bb23..86a58605c50 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json @@ -8,7 +8,7 @@ "payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest": "Payload.MultiPart.FileWithHttpPartOptionalContentTypeRequest", "payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest", "payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest", - "payload.multipart.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", + "payload.multipart.formdata.httpparts.nonstring.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", "payload.multipart.models.JsonPartRequest": "Payload.MultiPart.JsonPartRequest", "payload.multipart.models.MultiBinaryPartsRequest": "Payload.MultiPart.MultiBinaryPartsRequest", "payload.multipart.models.MultiPartRequest": "Payload.MultiPart.MultiPartRequest", diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py index f671b5edf94..a8091bbba72 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py @@ -16,7 +16,7 @@ from ._configuration import MultiPartClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import FormDataOperations +from .formdata.operations import FormDataOperations class MultiPartClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py index 5d8c9a57dd3..cf06ea8e258 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..formdata.aio.operations import FormDataOperations from ._configuration import MultiPartClientConfiguration -from .operations import FormDataOperations class MultiPartClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py similarity index 55% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py index b0dfe05e146..1bd7db3b544 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -22,24 +21,20 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import _model_base, models as _models -from ..._serialization import Deserializer, Serializer -from ..._vendor import FileType, prepare_multipart_form_data +from .... import _model_base, models as _models +from ...._serialization import Deserializer, Serializer +from ...._vendor import FileType, prepare_multipart_form_data +from ....aio._configuration import MultiPartClientConfiguration +from ...httpparts.aio.operations._operations import FormDataHttpPartsOperations from ...operations._operations import ( build_form_data_anonymous_model_request, build_form_data_basic_request, build_form_data_binary_array_parts_request, build_form_data_check_file_name_and_content_type_request, build_form_data_file_array_and_basic_request, - build_form_data_http_parts_content_type_image_jpeg_content_type_request, - build_form_data_http_parts_content_type_optional_content_type_request, - build_form_data_http_parts_content_type_required_content_type_request, - build_form_data_http_parts_json_array_and_file_array_request, - build_form_data_http_parts_non_string_float_request, build_form_data_json_part_request, build_form_data_multi_binary_parts_request, ) -from .._configuration import MultiPartClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -603,456 +598,3 @@ async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`http_parts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.content_type = FormDataHttpPartsContentTypeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.non_string = FormDataHttpPartsNonStringOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @overload - async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def json_array_and_file_array( - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_json_array_and_file_array_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsContentTypeOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`content_type` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def image_jpeg_content_type( - self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def image_jpeg_content_type( - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def required_content_type( - self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def required_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def required_content_type( - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_required_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def optional_content_type( - self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def optional_content_type( - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_optional_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsNonStringOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`non_string` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: ~payload.multipart.models.FloatRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def float(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Is either a FloatRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.FloatRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = [] - _data_fields: List[str] = ["temperature"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_non_string_float_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py new file mode 100644 index 00000000000..0097d2250a1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py @@ -0,0 +1,140 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ..... import _model_base, models as _models +from ....._serialization import Deserializer, Serializer +from ....._vendor import prepare_multipart_form_data +from .....aio._configuration import MultiPartClientConfiguration +from ...contenttype.aio.operations._operations import FormDataHttpPartsContentTypeOperations +from ...nonstring.aio.operations._operations import FormDataHttpPartsNonStringOperations +from ...operations._operations import build_form_data_http_parts_json_array_and_file_array_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def json_array_and_file_array( + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py new file mode 100644 index 00000000000..1dec8f9e50c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py @@ -0,0 +1,298 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...... import _model_base, models as _models +from ......_serialization import Deserializer, Serializer +from ......_vendor import prepare_multipart_form_data +from ......aio._configuration import MultiPartClientConfiguration +from ...operations._operations import ( + build_form_data_http_parts_content_type_image_jpeg_content_type_request, + build_form_data_http_parts_content_type_optional_content_type_request, + build_form_data_http_parts_content_type_required_content_type_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def image_jpeg_content_type( + self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def image_jpeg_content_type( + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def required_content_type( + self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def required_content_type( + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_required_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def optional_content_type( + self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def optional_content_type( + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_optional_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py new file mode 100644 index 00000000000..0f68f35f7b9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py @@ -0,0 +1,324 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..... import _model_base, models as _models +from ....._configuration import MultiPartClientConfiguration +from ....._serialization import Deserializer, Serializer +from ....._vendor import prepare_multipart_form_data + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/check-filename-and-specific-content-type-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/check-filename-and-required-content-type-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/file-with-http-part-optional-content-type" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def required_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_required_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def optional_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def optional_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_optional_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py new file mode 100644 index 00000000000..2d98c5305b8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ...... import _model_base +from ......_serialization import Deserializer, Serializer +from ......_vendor import prepare_multipart_form_data +from ......aio._configuration import MultiPartClientConfiguration +from ...operations._operations import build_form_data_http_parts_non_string_float_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: ~payload.multipart.models.FloatRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def float(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_non_string_float_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py new file mode 100644 index 00000000000..e16e485d421 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + FloatRequest, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "FloatRequest", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py new file mode 100644 index 00000000000..368bfebfef2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ..... import _model_base +from ....._model_base import rest_field + + +class FloatRequest(_model_base.Model): + """FloatRequest. + + :ivar temperature: Required. + :vartype temperature: float + """ + + temperature: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + temperature: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py new file mode 100644 index 00000000000..6a2fd172685 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py @@ -0,0 +1,144 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..... import _model_base +from ....._configuration import MultiPartClientConfiguration +from ....._serialization import Deserializer, Serializer +from ....._vendor import prepare_multipart_form_data + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/non-string-float" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: ~payload.multipart.models.FloatRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def float(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_non_string_float_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py new file mode 100644 index 00000000000..ba5ff606963 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .... import _model_base, models as _models +from ...._configuration import MultiPartClientConfiguration +from ...._serialization import Deserializer, Serializer +from ...._vendor import prepare_multipart_form_data +from ..contenttype.operations._operations import FormDataHttpPartsContentTypeOperations +from ..nonstring.operations._operations import FormDataHttpPartsNonStringOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/complex-parts-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py similarity index 56% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py index 138e8d8a73b..29d9b4b0354 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -23,10 +22,11 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import _model_base, models as _models -from .._configuration import MultiPartClientConfiguration -from .._serialization import Deserializer, Serializer -from .._vendor import FileType, prepare_multipart_form_data +from ... import _model_base, models as _models +from ..._configuration import MultiPartClientConfiguration +from ..._serialization import Deserializer, Serializer +from ..._vendor import FileType, prepare_multipart_form_data +from ..httpparts.operations._operations import FormDataHttpPartsOperations if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -106,59 +106,6 @@ def build_form_data_anonymous_model_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/complex-parts-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/check-filename-and-specific-content-type-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/check-filename-and-required-content-type-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/file-with-http-part-optional-content-type" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/non-string-float" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - class FormDataOperations: """ .. warning:: @@ -723,452 +670,3 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`http_parts` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.content_type = FormDataHttpPartsContentTypeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.non_string = FormDataHttpPartsNonStringOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @overload - def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def json_array_and_file_array( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_json_array_and_file_array_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsContentTypeOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`content_type` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def required_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def required_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_required_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def optional_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def optional_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_optional_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class FormDataHttpPartsNonStringOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`non_string` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: ~payload.multipart.models.FloatRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def float(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def float( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FloatRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Is either a FloatRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.FloatRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = [] - _data_fields: List[str] = ["temperature"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_non_string_float_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py index 46cfc048f65..9533076c687 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py @@ -21,7 +21,6 @@ FileWithHttpPartOptionalContentTypeRequest, FileWithHttpPartRequiredContentTypeRequest, FileWithHttpPartSpecificContentTypeRequest, - FloatRequest, JsonPartRequest, MultiBinaryPartsRequest, MultiPartRequest, @@ -38,7 +37,6 @@ "FileWithHttpPartOptionalContentTypeRequest", "FileWithHttpPartRequiredContentTypeRequest", "FileWithHttpPartSpecificContentTypeRequest", - "FloatRequest", "JsonPartRequest", "MultiBinaryPartsRequest", "MultiPartRequest", diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py index ce3efa2d35e..e09cb4ea0d4 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py @@ -271,34 +271,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FloatRequest(_model_base.Model): - """FloatRequest. - - :ivar temperature: Required. - :vartype temperature: float - """ - - temperature: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - temperature: float, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class JsonPartRequest(_model_base.Model): """JsonPartRequest. diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/setup.py b/packages/typespec-python/test/azure/generated/payload-multipart/setup.py index 2982b7e880c..04a560fcac6 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-multipart" +PACKAGE_NAMESPACE = "payload.multipart" PACKAGE_PPRINT_NAME = "Payload Multipart" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-pageable/MANIFEST.in index f2e18952488..24d62ee29fd 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-pageable/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/pageable/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/README.md b/packages/typespec-python/test/azure/generated/payload-pageable/README.md index 6b6afe92184..f4500dd3a18 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/README.md +++ b/packages/typespec-python/test/azure/generated/payload-pageable/README.md @@ -1,5 +1,3 @@ - - # Payload Pageable client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-pageable - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Pageable instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_client.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_client.py index b46b94ad514..967152cad99 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_client.py @@ -16,7 +16,7 @@ from ._configuration import PageableClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ServerDrivenPaginationOperations +from .serverdrivenpagination.operations import ServerDrivenPaginationOperations class PageableClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_client.py index e9c97b922a8..402f54fdcf4 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..serverdrivenpagination.aio.operations import ServerDrivenPaginationOperations from ._configuration import PageableClientConfiguration -from .operations import ServerDrivenPaginationOperations class PageableClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py new file mode 100644 index 00000000000..ee891749177 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace + +from .... import models as _models +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import PageableClientConfiguration +from ...continuationtoken.aio.operations._operations import ServerDrivenPaginationContinuationTokenOperations +from ...operations._operations import build_server_driven_pagination_link_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServerDrivenPaginationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.pageable.aio.PageableClient`'s + :attr:`server_driven_pagination` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: + """link. + + :return: An iterator like instance of Pet + :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_driven_pagination_link_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("next") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py similarity index 79% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index ddda8102545..aaf4e07ffba 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -22,17 +22,16 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace -from ... import models as _models -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer +from ..... import models as _models +from ....._model_base import _deserialize +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import PageableClientConfiguration from ...operations._operations import ( build_server_driven_pagination_continuation_token_request_header_response_body_request, build_server_driven_pagination_continuation_token_request_header_response_header_request, build_server_driven_pagination_continuation_token_request_query_response_body_request, build_server_driven_pagination_continuation_token_request_query_response_header_request, - build_server_driven_pagination_link_request, ) -from .._configuration import PageableClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -42,98 +41,6 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ServerDrivenPaginationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.pageable.aio.PageableClient`'s - :attr:`server_driven_pagination` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: - """link. - - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_link_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("next") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - class ServerDrivenPaginationContinuationTokenOperations: # pylint: disable=name-too-long """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py similarity index 81% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 1e35a00664c..0077c898289 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -24,10 +24,10 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models -from .._configuration import PageableClientConfiguration -from .._model_base import _deserialize -from .._serialization import Deserializer, Serializer +from .... import models as _models +from ...._configuration import PageableClientConfiguration +from ...._model_base import _deserialize +from ...._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -40,20 +40,6 @@ _SERIALIZER.client_side_validation = False -def build_server_driven_pagination_link_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/payload/pageable/server-driven-pagination/link" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - def build_server_driven_pagination_continuation_token_request_query_response_body_request( # pylint: disable=name-too-long *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any ) -> HttpRequest: @@ -154,98 +140,6 @@ def build_server_driven_pagination_continuation_token_request_header_response_he return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class ServerDrivenPaginationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.pageable.PageableClient`'s - :attr:`server_driven_pagination` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: - """link. - - :return: An iterator like instance of Pet - :rtype: ~azure.core.paging.ItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_link_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("next") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - class ServerDrivenPaginationContinuationTokenOperations: # pylint: disable=name-too-long """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py new file mode 100644 index 00000000000..5a0ccb0581e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -0,0 +1,146 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._configuration import PageableClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer +from ..continuationtoken.operations._operations import ServerDrivenPaginationContinuationTokenOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_server_driven_pagination_link_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/payload/pageable/server-driven-pagination/link" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class ServerDrivenPaginationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.pageable.PageableClient`'s + :attr:`server_driven_pagination` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: + """link. + + :return: An iterator like instance of Pet + :rtype: ~azure.core.paging.ItemPaged[~payload.pageable.models.Pet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_driven_pagination_link_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("next") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/setup.py b/packages/typespec-python/test/azure/generated/payload-pageable/setup.py index 9a2b465020b..c488cdeacf6 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-pageable" +PACKAGE_NAMESPACE = "payload.pageable" PACKAGE_PPRINT_NAME = "Payload Pageable" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-xml/MANIFEST.in b/packages/typespec-python/test/azure/generated/payload-xml/MANIFEST.in index 07a0c716455..ef8f20ba112 100644 --- a/packages/typespec-python/test/azure/generated/payload-xml/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/payload-xml/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/xml/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-xml/README.md b/packages/typespec-python/test/azure/generated/payload-xml/README.md index 34bf5fe0496..3ffbae66c91 100644 --- a/packages/typespec-python/test/azure/generated/payload-xml/README.md +++ b/packages/typespec-python/test/azure/generated/payload-xml/README.md @@ -1,5 +1,3 @@ - - # Payload Xml client library for Python @@ -17,6 +15,7 @@ python -m pip install payload-xml - You need an [Azure subscription][azure_sub] to use this package. - An existing Payload Xml instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/payload-xml/setup.py b/packages/typespec-python/test/azure/generated/payload-xml/setup.py index b23b07fd542..55f91ca1551 100644 --- a/packages/typespec-python/test/azure/generated/payload-xml/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-xml/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-xml" +PACKAGE_NAMESPACE = "payload.xml" PACKAGE_PPRINT_NAME = "Payload Xml" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in index 7afdb8f1707..0afda28e610 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in @@ -4,4 +4,4 @@ include resiliency/srv/driven1/py.typed recursive-include tests *.py recursive-include samples *.py *.md include resiliency/__init__.py -include resiliency/srv/__init__.py \ No newline at end of file +include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md index a2c41ff113f..74ce9cfcdee 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md @@ -1,5 +1,3 @@ - - # ResiliencySrvDriven1 client library for Python @@ -17,6 +15,7 @@ python -m pip install resiliency-srv-driven1 - You need an [Azure subscription][azure_sub] to use this package. - An existing ResiliencySrvDriven1 instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py index 4d1275b375c..91bf8bdba79 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "resiliency-srv-driven1" +PACKAGE_NAMESPACE = "resiliency.srv.driven1" PACKAGE_PPRINT_NAME = "ResiliencySrvDriven1" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in index 299f0760ca6..22e737be264 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in @@ -4,4 +4,4 @@ include resiliency/srv/driven2/py.typed recursive-include tests *.py recursive-include samples *.py *.md include resiliency/__init__.py -include resiliency/srv/__init__.py \ No newline at end of file +include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md index a6703b3c658..18f39c6183d 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md @@ -1,5 +1,3 @@ - - # ResiliencySrvDriven2 client library for Python @@ -17,6 +15,7 @@ python -m pip install resiliency-srv-driven2 - You need an [Azure subscription][azure_sub] to use this package. - An existing ResiliencySrvDriven2 instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py index 7e8b174127d..f5c15b726b2 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "resiliency-srv-driven2" +PACKAGE_NAMESPACE = "resiliency.srv.driven2" PACKAGE_PPRINT_NAME = "ResiliencySrvDriven2" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/response-status-code-range/MANIFEST.in b/packages/typespec-python/test/azure/generated/response-status-code-range/MANIFEST.in index 87b2b3fe020..3b3539da09f 100644 --- a/packages/typespec-python/test/azure/generated/response-status-code-range/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/response-status-code-range/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include response/statuscoderange/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include response/__init__.py \ No newline at end of file +include response/__init__.py diff --git a/packages/typespec-python/test/azure/generated/response-status-code-range/README.md b/packages/typespec-python/test/azure/generated/response-status-code-range/README.md index 5e4613dfc2b..a29a98fa666 100644 --- a/packages/typespec-python/test/azure/generated/response-status-code-range/README.md +++ b/packages/typespec-python/test/azure/generated/response-status-code-range/README.md @@ -1,5 +1,3 @@ - - # Response Statuscoderange client library for Python @@ -17,6 +15,7 @@ python -m pip install response-statuscoderange - You need an [Azure subscription][azure_sub] to use this package. - An existing Response Statuscoderange instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py b/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py index 08d9d67db36..8ead782258a 100644 --- a/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py +++ b/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "response-statuscoderange" +PACKAGE_NAMESPACE = "response.statuscoderange" PACKAGE_PPRINT_NAME = "Response Statuscoderange" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/routes/MANIFEST.in b/packages/typespec-python/test/azure/generated/routes/MANIFEST.in index d3777f92f7f..0d81e3a9d35 100644 --- a/packages/typespec-python/test/azure/generated/routes/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/routes/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include routes/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/azure/generated/routes/README.md b/packages/typespec-python/test/azure/generated/routes/README.md index 492036ee953..417beeedb40 100644 --- a/packages/typespec-python/test/azure/generated/routes/README.md +++ b/packages/typespec-python/test/azure/generated/routes/README.md @@ -1,5 +1,3 @@ - - # Routes client library for Python @@ -17,6 +15,7 @@ python -m pip install routes - You need an [Azure subscription][azure_sub] to use this package. - An existing Routes instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_client.py b/packages/typespec-python/test/azure/generated/routes/routes/_client.py index 7e94d2e04ef..45fa7930063 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/_client.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/_client.py @@ -16,12 +16,9 @@ from ._configuration import RoutesClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ( - InInterfaceOperations, - PathParametersOperations, - QueryParametersOperations, - RoutesClientOperationsMixin, -) +from .operations import InInterfaceOperations, RoutesClientOperationsMixin +from .pathparameters.operations import PathParametersOperations +from .queryparameters.operations import QueryParametersOperations class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py index 8af3b6a1eef..7345d6d8d94 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py @@ -15,13 +15,10 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..pathparameters.aio.operations import PathParametersOperations +from ..queryparameters.aio.operations import QueryParametersOperations from ._configuration import RoutesClientConfiguration -from .operations import ( - InInterfaceOperations, - PathParametersOperations, - QueryParametersOperations, - RoutesClientOperationsMixin, -) +from .operations import InInterfaceOperations, RoutesClientOperationsMixin class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py index 60c9a9b554a..830cd9bf21f 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import PathParametersOperations # type: ignore -from ._operations import QueryParametersOperations # type: ignore from ._operations import InInterfaceOperations # type: ignore from ._operations import RoutesClientOperationsMixin # type: ignore @@ -22,8 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PathParametersOperations", - "QueryParametersOperations", "InInterfaceOperations", "RoutesClientOperationsMixin", ] diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py index 01a796e09b6..8cc6873b594 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -23,54 +23,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_in_interface_fixed_request, - build_path_parameters_annotation_only_request, - build_path_parameters_explicit_request, - build_path_parameters_label_expansion_explode_array_request, - build_path_parameters_label_expansion_explode_primitive_request, - build_path_parameters_label_expansion_explode_record_request, - build_path_parameters_label_expansion_standard_array_request, - build_path_parameters_label_expansion_standard_primitive_request, - build_path_parameters_label_expansion_standard_record_request, - build_path_parameters_matrix_expansion_explode_array_request, - build_path_parameters_matrix_expansion_explode_primitive_request, - build_path_parameters_matrix_expansion_explode_record_request, - build_path_parameters_matrix_expansion_standard_array_request, - build_path_parameters_matrix_expansion_standard_primitive_request, - build_path_parameters_matrix_expansion_standard_record_request, - build_path_parameters_path_expansion_explode_array_request, - build_path_parameters_path_expansion_explode_primitive_request, - build_path_parameters_path_expansion_explode_record_request, - build_path_parameters_path_expansion_standard_array_request, - build_path_parameters_path_expansion_standard_primitive_request, - build_path_parameters_path_expansion_standard_record_request, - build_path_parameters_reserved_expansion_annotation_request, - build_path_parameters_reserved_expansion_template_request, - build_path_parameters_simple_expansion_explode_array_request, - build_path_parameters_simple_expansion_explode_primitive_request, - build_path_parameters_simple_expansion_explode_record_request, - build_path_parameters_simple_expansion_standard_array_request, - build_path_parameters_simple_expansion_standard_primitive_request, - build_path_parameters_simple_expansion_standard_record_request, - build_path_parameters_template_only_request, - build_query_parameters_annotation_only_request, - build_query_parameters_explicit_request, - build_query_parameters_query_continuation_explode_array_request, - build_query_parameters_query_continuation_explode_primitive_request, - build_query_parameters_query_continuation_explode_record_request, - build_query_parameters_query_continuation_standard_array_request, - build_query_parameters_query_continuation_standard_primitive_request, - build_query_parameters_query_continuation_standard_record_request, - build_query_parameters_query_expansion_explode_array_request, - build_query_parameters_query_expansion_explode_primitive_request, - build_query_parameters_query_expansion_explode_record_request, - build_query_parameters_query_expansion_standard_array_request, - build_query_parameters_query_expansion_standard_primitive_request, - build_query_parameters_query_expansion_standard_record_request, - build_query_parameters_template_only_request, - build_routes_fixed_request, -) +from ...operations._operations import build_in_interface_fixed_request, build_routes_fixed_request from .._configuration import RoutesClientConfiguration from .._vendor import RoutesClientMixinABC @@ -82,189 +35,14 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class PathParametersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`path_parameters` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.reserved_expansion = PathParametersReservedExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.simple_expansion = PathParametersSimpleExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.path_expansion = PathParametersPathExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.label_expansion = PathParametersLabelExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.matrix_expansion = PathParametersMatrixExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace_async - async def template_only(self, param: str, **kwargs: Any) -> None: - """template_only. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_template_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def explicit(self, param: str, **kwargs: Any) -> None: - """explicit. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_explicit_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def annotation_only(self, param: str, **kwargs: Any) -> None: - """annotation_only. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_annotation_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersOperations: +class InInterfaceOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~routes.aio.RoutesClient`'s - :attr:`query_parameters` attribute. + :attr:`in_interface` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -274,113 +52,10 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - self.query_expansion = QueryParametersQueryExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.query_continuation = QueryParametersQueryContinuationOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace_async - async def template_only(self, *, param: str, **kwargs: Any) -> None: - """template_only. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_template_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace_async - async def explicit(self, *, param: str, **kwargs: Any) -> None: - """explicit. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_explicit_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def annotation_only(self, *, param: str, **kwargs: Any) -> None: - """annotation_only. + async def fixed(self, **kwargs: Any) -> None: + """fixed. - :keyword param: Required. - :paramtype param: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -398,8 +73,7 @@ async def annotation_only(self, *, param: str, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_query_parameters_annotation_only_request( - param=param, + _request = build_in_interface_fixed_request( headers=_headers, params=_params, ) @@ -423,22 +97,7 @@ async def annotation_only(self, *, param: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore -class InInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`in_interface` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") +class RoutesClientOperationsMixin(RoutesClientMixinABC): @distributed_trace_async async def fixed(self, **kwargs: Any) -> None: @@ -461,54 +120,7 @@ async def fixed(self, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_in_interface_fixed_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RoutesClientOperationsMixin(RoutesClientMixinABC): - - @distributed_trace_async - async def fixed(self, **kwargs: Any) -> None: - """fixed. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_routes_fixed_request( + _request = build_routes_fixed_request( headers=_headers, params=_params, ) @@ -530,2173 +142,3 @@ async def fixed(self, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`reserved_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def template(self, param: str, **kwargs: Any) -> None: - """template. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_reserved_expansion_template_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def annotation(self, param: str, **kwargs: Any) -> None: - """annotation. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_reserved_expansion_annotation_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersSimpleExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`simple_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersSimpleExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersSimpleExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersPathExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`path_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersPathExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersPathExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersLabelExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`label_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersLabelExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersLabelExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersMatrixExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`matrix_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersMatrixExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersMatrixExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class QueryParametersQueryExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`query_expansion` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = QueryParametersQueryExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = QueryParametersQueryExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`query_continuation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = QueryParametersQueryContinuationStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = QueryParametersQueryContinuationExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, param: str, **kwargs: Any) -> None: - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, param: List[str], **kwargs: Any) -> None: - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, *, param: str, **kwargs: Any) -> None: - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, *, param: List[str], **kwargs: Any) -> None: - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, *, param: str, **kwargs: Any) -> None: - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, *, param: List[str], **kwargs: Any) -> None: - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, *, param: str, **kwargs: Any) -> None: - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, *, param: List[str], **kwargs: Any) -> None: - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.aio.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def primitive(self, *, param: str, **kwargs: Any) -> None: - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def array(self, *, param: List[str], **kwargs: Any) -> None: - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py index 60c9a9b554a..830cd9bf21f 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import PathParametersOperations # type: ignore -from ._operations import QueryParametersOperations # type: ignore from ._operations import InInterfaceOperations # type: ignore from ._operations import RoutesClientOperationsMixin # type: ignore @@ -22,8 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PathParametersOperations", - "QueryParametersOperations", "InInterfaceOperations", "RoutesClientOperationsMixin", ] diff --git a/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py index d499c0fc9a7..3662220cf24 100644 --- a/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -21,7 +20,6 @@ from azure.core.pipeline import PipelineResponse from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict from .._configuration import RoutesClientConfiguration from .._serialization import Deserializer, Serializer @@ -38,3101 +36,28 @@ _SERIALIZER.client_side_validation = False -def build_path_parameters_template_only_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/template-only/{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_explicit_request(param: str, **kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/routes/path/explicit/{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_annotation_only_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/annotation-only/{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_query_parameters_template_only_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/template-only" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_explicit_request(*, param: str, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/explicit" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_annotation_only_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/annotation-only" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_in_interface_fixed_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/routes/in-interface/fixed" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_routes_fixed_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/routes/fixed" - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_reserved_expansion_template_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/reserved-expansion/template/{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_reserved_expansion_annotation_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/reserved-expansion/annotation/{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_standard_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/standard/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_standard_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/standard/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_standard_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/standard/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_explode_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/explode/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_explode_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/explode/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_simple_expansion_explode_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/simple/explode/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_standard_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/standard/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_standard_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/standard/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_standard_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/standard/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_explode_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/explode/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_explode_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/explode/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_path_expansion_explode_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/path/explode/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_standard_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/standard/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_standard_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/standard/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_standard_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/standard/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_explode_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/explode/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_explode_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/explode/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_label_expansion_explode_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/label/explode/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_standard_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/standard/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_standard_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/standard/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_standard_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/standard/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_explode_primitive_request( # pylint: disable=name-too-long - param: str, **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/explode/primitive{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_explode_array_request( # pylint: disable=name-too-long - param: List[str], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/explode/array{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "[str]"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_path_parameters_matrix_expansion_explode_record_request( # pylint: disable=name-too-long - param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - # Construct URL - _url = "/routes/path/matrix/explode/record{param}" - path_format_arguments = { - "param": _SERIALIZER.url("param", param, "{int}"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - return HttpRequest(method="GET", url=_url, **kwargs) - - -def build_query_parameters_query_expansion_standard_primitive_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/standard/primitive" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_expansion_standard_array_request( # pylint: disable=name-too-long - *, param: List[str], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/standard/array" - - # Construct parameters - _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_expansion_standard_record_request( # pylint: disable=name-too-long - *, param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/standard/record" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "{int}") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_expansion_explode_primitive_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/explode/primitive" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_expansion_explode_array_request( # pylint: disable=name-too-long - *, param: List[str], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/explode/array" - - # Construct parameters - _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_expansion_explode_record_request( # pylint: disable=name-too-long - *, param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-expansion/explode/record" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "{int}") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_standard_primitive_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/standard/primitive?fixed=true" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_standard_array_request( # pylint: disable=name-too-long - *, param: List[str], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/standard/array?fixed=true" - - # Construct parameters - _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_standard_record_request( # pylint: disable=name-too-long - *, param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/standard/record?fixed=true" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "{int}") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_explode_primitive_request( # pylint: disable=name-too-long - *, param: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/explode/primitive?fixed=true" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_explode_array_request( # pylint: disable=name-too-long - *, param: List[str], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/explode/array?fixed=true" - - # Construct parameters - _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_parameters_query_continuation_explode_record_request( # pylint: disable=name-too-long - *, param: Dict[str, int], **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/routes/query/query-continuation/explode/record?fixed=true" - - # Construct parameters - _params["param"] = _SERIALIZER.query("param", param, "{int}") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -class PathParametersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`path_parameters` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.reserved_expansion = PathParametersReservedExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.simple_expansion = PathParametersSimpleExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.path_expansion = PathParametersPathExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.label_expansion = PathParametersLabelExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.matrix_expansion = PathParametersMatrixExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """template_only. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_template_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """explicit. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_explicit_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def annotation_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """annotation_only. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_annotation_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`query_parameters` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.query_expansion = QueryParametersQueryExpansionOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.query_continuation = QueryParametersQueryContinuationOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def template_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """template_only. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_template_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """explicit. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_explicit_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def annotation_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """annotation_only. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_annotation_only_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class InInterfaceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`in_interface` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """fixed. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_in_interface_fixed_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RoutesClientOperationsMixin(RoutesClientMixinABC): - - @distributed_trace - def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """fixed. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_routes_fixed_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`reserved_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """template. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_reserved_expansion_template_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """annotation. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_reserved_expansion_annotation_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersSimpleExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`simple_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersSimpleExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersSimpleExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersPathExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`path_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersPathExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersPathExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersLabelExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`label_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersLabelExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersLabelExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersMatrixExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`matrix_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = PathParametersMatrixExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = PathParametersMatrixExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class QueryParametersQueryExpansionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`query_expansion` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = QueryParametersQueryExpansionStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = QueryParametersQueryExpansionExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`query_continuation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.standard = QueryParametersQueryContinuationStandardOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.explode = QueryParametersQueryContinuationExplodeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - -class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_simple_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_path_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_label_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :param param: Required. - :type param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :param param: Required. - :type param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :param param: Required. - :type param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_path_parameters_matrix_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_expansion_explode_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~routes.RoutesClient`'s - :attr:`standard` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. - - :keyword param: Required. - :paramtype param: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_primitive_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. - - :keyword param: Required. - :paramtype param: dict[str, int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_standard_record_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_in_interface_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/in-interface/fixed" - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return HttpRequest(method="GET", url=_url, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) +def build_routes_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/fixed" - if cls: - return cls(pipeline_response, None, {}) # type: ignore + return HttpRequest(method="GET", url=_url, **kwargs) -class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long +class InInterfaceOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~routes.RoutesClient`'s - :attr:`explode` attribute. + :attr:`in_interface` attribute. """ def __init__(self, *args, **kwargs): @@ -3143,11 +68,9 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """primitive. + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. - :keyword param: Required. - :paramtype param: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3165,8 +88,7 @@ def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=in cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_query_parameters_query_continuation_explode_primitive_request( - param=param, + _request = build_in_interface_fixed_request( headers=_headers, params=_params, ) @@ -3189,59 +111,13 @@ def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=in if cls: return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace - def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """array. - - :keyword param: Required. - :paramtype param: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_parameters_query_continuation_explode_array_request( - param=param, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - if cls: - return cls(pipeline_response, None, {}) # type: ignore +class RoutesClientOperationsMixin(RoutesClientMixinABC): @distributed_trace - def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """record. + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. - :keyword param: Required. - :paramtype param: dict[str, int] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3259,8 +135,7 @@ def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: di cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_query_parameters_query_continuation_explode_record_request( - param=param, + _request = build_routes_fixed_request( headers=_headers, params=_params, ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/__init__.py new file mode 100644 index 00000000000..fc6dacce9a2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PathParametersOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_operations.py new file mode 100644 index 00000000000..51072c593cd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_operations.py @@ -0,0 +1,217 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import RoutesClientConfiguration +from ...labelexpansion.aio.operations._operations import PathParametersLabelExpansionOperations +from ...matrixexpansion.aio.operations._operations import PathParametersMatrixExpansionOperations +from ...operations._operations import ( + build_path_parameters_annotation_only_request, + build_path_parameters_explicit_request, + build_path_parameters_template_only_request, +) +from ...pathexpansion.aio.operations._operations import PathParametersPathExpansionOperations +from ...reservedexpansion.aio.operations._operations import PathParametersReservedExpansionOperations +from ...simpleexpansion.aio.operations._operations import PathParametersSimpleExpansionOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace_async + async def template_only(self, param: str, **kwargs: Any) -> None: + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def explicit(self, param: str, **kwargs: Any) -> None: + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation_only(self, param: str, **kwargs: Any) -> None: + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..04e02bd6daa --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import PathParametersLabelExpansionExplodeOperations +from ...standard.aio.operations._operations import PathParametersLabelExpansionStandardOperations + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..1ad7449bc11 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_label_expansion_explode_array_request, + build_path_parameters_label_expansion_explode_primitive_request, + build_path_parameters_label_expansion_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_operations.py new file mode 100644 index 00000000000..07409f56547 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_label_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_operations.py new file mode 100644 index 00000000000..f714b5a0a4f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import PathParametersLabelExpansionExplodeOperations +from ..standard.operations._operations import PathParametersLabelExpansionStandardOperations + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..f0d8044500a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_label_expansion_standard_array_request, + build_path_parameters_label_expansion_standard_primitive_request, + build_path_parameters_label_expansion_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_operations.py new file mode 100644 index 00000000000..1d9d9c7e5ad --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_label_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/labelexpansion/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..5b747f1cca1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import PathParametersMatrixExpansionExplodeOperations +from ...standard.aio.operations._operations import PathParametersMatrixExpansionStandardOperations + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..317a1b584fc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_matrix_expansion_explode_array_request, + build_path_parameters_matrix_expansion_explode_primitive_request, + build_path_parameters_matrix_expansion_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_operations.py new file mode 100644 index 00000000000..405fd2801f6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_matrix_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_operations.py new file mode 100644 index 00000000000..bcbe3d09bd5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import PathParametersMatrixExpansionExplodeOperations +from ..standard.operations._operations import PathParametersMatrixExpansionStandardOperations + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..38880e6067a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_matrix_expansion_standard_array_request, + build_path_parameters_matrix_expansion_standard_primitive_request, + build_path_parameters_matrix_expansion_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_operations.py new file mode 100644 index 00000000000..99f775b8211 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_matrix_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/matrixexpansion/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/__init__.py new file mode 100644 index 00000000000..fc6dacce9a2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PathParametersOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_operations.py new file mode 100644 index 00000000000..d6d80682e13 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_operations.py @@ -0,0 +1,255 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ..._configuration import RoutesClientConfiguration +from ..._serialization import Deserializer, Serializer +from ..labelexpansion.operations._operations import PathParametersLabelExpansionOperations +from ..matrixexpansion.operations._operations import PathParametersMatrixExpansionOperations +from ..pathexpansion.operations._operations import PathParametersPathExpansionOperations +from ..reservedexpansion.operations._operations import PathParametersReservedExpansionOperations +from ..simpleexpansion.operations._operations import PathParametersSimpleExpansionOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_template_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/template-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_explicit_request(param: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/path/explicit/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_annotation_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/annotation-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..9e37a7bc57e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import PathParametersPathExpansionExplodeOperations +from ...standard.aio.operations._operations import PathParametersPathExpansionStandardOperations + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..14ea8bba16c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_path_expansion_explode_array_request, + build_path_parameters_path_expansion_explode_primitive_request, + build_path_parameters_path_expansion_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_operations.py new file mode 100644 index 00000000000..75272bcae45 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_path_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_operations.py new file mode 100644 index 00000000000..bfc9d1b6cf4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import PathParametersPathExpansionExplodeOperations +from ..standard.operations._operations import PathParametersPathExpansionStandardOperations + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..0eb26bc5cf3 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_path_expansion_standard_array_request, + build_path_parameters_path_expansion_standard_primitive_request, + build_path_parameters_path_expansion_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_operations.py new file mode 100644 index 00000000000..3a1263419dc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_path_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/pathexpansion/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..e35160f1d36 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_operations.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_reserved_expansion_annotation_request, + build_path_parameters_reserved_expansion_template_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def template(self, param: str, **kwargs: Any) -> None: + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation(self, param: str, **kwargs: Any) -> None: + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_operations.py new file mode 100644 index 00000000000..6404752c1de --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_operations.py @@ -0,0 +1,175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_reserved_expansion_template_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/template/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_reserved_expansion_annotation_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/annotation/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/reservedexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..415fb2ee17a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import PathParametersSimpleExpansionExplodeOperations +from ...standard.aio.operations._operations import PathParametersSimpleExpansionStandardOperations + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..a1934ebd9bd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_simple_expansion_explode_array_request, + build_path_parameters_simple_expansion_explode_primitive_request, + build_path_parameters_simple_expansion_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_operations.py new file mode 100644 index 00000000000..531f26f1a64 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_simple_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_operations.py new file mode 100644 index 00000000000..6ecc41d56f4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import PathParametersSimpleExpansionExplodeOperations +from ..standard.operations._operations import PathParametersSimpleExpansionStandardOperations + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..afa5efcbff5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_path_parameters_simple_expansion_standard_array_request, + build_path_parameters_simple_expansion_standard_primitive_request, + build_path_parameters_simple_expansion_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_operations.py new file mode 100644 index 00000000000..51709420fdb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_simple_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/pathparameters/simpleexpansion/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/__init__.py new file mode 100644 index 00000000000..2a3caa32eab --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryParametersOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryParametersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_operations.py new file mode 100644 index 00000000000..7d21ac809a8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_operations.py @@ -0,0 +1,205 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_query_parameters_annotation_only_request, + build_query_parameters_explicit_request, + build_query_parameters_template_only_request, +) +from ...querycontinuation.aio.operations._operations import QueryParametersQueryContinuationOperations +from ...queryexpansion.aio.operations._operations import QueryParametersQueryExpansionOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace_async + async def template_only(self, *, param: str, **kwargs: Any) -> None: + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def explicit(self, *, param: str, **kwargs: Any) -> None: + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation_only(self, *, param: str, **kwargs: Any) -> None: + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/__init__.py new file mode 100644 index 00000000000..2a3caa32eab --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import QueryParametersOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "QueryParametersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_operations.py new file mode 100644 index 00000000000..d74558a9393 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_operations.py @@ -0,0 +1,244 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ..._configuration import RoutesClientConfiguration +from ..._serialization import Deserializer, Serializer +from ..querycontinuation.operations._operations import QueryParametersQueryContinuationOperations +from ..queryexpansion.operations._operations import QueryParametersQueryExpansionOperations + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_parameters_template_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/template-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_explicit_request(*, param: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/explicit" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_annotation_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/annotation-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def template_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_operations.py new file mode 100644 index 00000000000..5cfd81ed40f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import QueryParametersQueryContinuationExplodeOperations +from ...standard.aio.operations._operations import QueryParametersQueryContinuationStandardOperations + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..edbdd1c4104 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_query_parameters_query_continuation_explode_array_request, + build_query_parameters_query_continuation_explode_primitive_request, + build_query_parameters_query_continuation_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_operations.py new file mode 100644 index 00000000000..94b7afe8e0b --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_parameters_query_continuation_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_operations.py new file mode 100644 index 00000000000..1be220a2d55 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import QueryParametersQueryContinuationExplodeOperations +from ..standard.operations._operations import QueryParametersQueryContinuationStandardOperations + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..4862b597636 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_query_parameters_query_continuation_standard_array_request, + build_query_parameters_query_continuation_standard_primitive_request, + build_query_parameters_query_continuation_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_operations.py new file mode 100644 index 00000000000..3cc9b171aef --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_parameters_query_continuation_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/querycontinuation/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_operations.py new file mode 100644 index 00000000000..fc3aba35f11 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import AsyncPipelineClient + +from ....._serialization import Deserializer, Serializer +from .....aio._configuration import RoutesClientConfiguration +from ...explode.aio.operations._operations import QueryParametersQueryExpansionExplodeOperations +from ...standard.aio.operations._operations import QueryParametersQueryExpansionStandardOperations + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_operations.py new file mode 100644 index 00000000000..6de8790d6b2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_query_parameters_query_expansion_explode_array_request, + build_query_parameters_query_expansion_explode_primitive_request, + build_query_parameters_query_expansion_explode_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_operations.py new file mode 100644 index 00000000000..cb190e15d50 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_parameters_query_expansion_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/explode/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_operations.py new file mode 100644 index 00000000000..1b07e28ec71 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_operations.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.core import PipelineClient + +from ...._configuration import RoutesClientConfiguration +from ...._serialization import Deserializer, Serializer +from ..explode.operations._operations import QueryParametersQueryExpansionExplodeOperations +from ..standard.operations._operations import QueryParametersQueryExpansionStandardOperations + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_operations.py new file mode 100644 index 00000000000..e3920ee16d1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ......_serialization import Deserializer, Serializer +from ......aio._configuration import RoutesClientConfiguration +from ...operations._operations import ( + build_query_parameters_query_expansion_standard_array_request, + build_query_parameters_query_expansion_standard_primitive_request, + build_query_parameters_query_expansion_standard_record_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/__init__.py new file mode 100644 index 00000000000..933fcd7d1b5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_operations.py new file mode 100644 index 00000000000..1fea97d4cd6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from ....._configuration import RoutesClientConfiguration +from ....._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_query_parameters_query_expansion_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: RoutesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/queryparameters/queryexpansion/standard/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/setup.py b/packages/typespec-python/test/azure/generated/routes/setup.py index abbeba859d6..4ec644ed09d 100644 --- a/packages/typespec-python/test/azure/generated/routes/setup.py +++ b/packages/typespec-python/test/azure/generated/routes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "routes" +PACKAGE_NAMESPACE = "routes" PACKAGE_PPRINT_NAME = "Routes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/MANIFEST.in b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/MANIFEST.in index ae346d7ed79..129d71d3353 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/MANIFEST.in @@ -4,4 +4,4 @@ include serialization/encodedname/json/py.typed recursive-include tests *.py recursive-include samples *.py *.md include serialization/__init__.py -include serialization/encodedname/__init__.py \ No newline at end of file +include serialization/encodedname/__init__.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/README.md b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/README.md index dcb438fa117..d6cf0487387 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/README.md +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/README.md @@ -1,5 +1,3 @@ - - # Serialization Encodedname Json client library for Python @@ -17,6 +15,7 @@ python -m pip install serialization-encodedname-json - You need an [Azure subscription][azure_sub] to use this package. - An existing Serialization Encodedname Json instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json index cd41bacf9ac..16ba9487d60 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Serialization.EncodedName.Json", "CrossLanguageDefinitionId": { - "serialization.encodedname.json.models.JsonEncodedNameModel": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", + "serialization.encodedname.json.property.models.JsonEncodedNameModel": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", "serialization.encodedname.json.JsonClient.property.send": "Serialization.EncodedName.Json.Property.send", "serialization.encodedname.json.JsonClient.property.get": "Serialization.EncodedName.Json.Property.get" } diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py index 3fb191aaf4f..62a9bcf2a27 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py @@ -16,7 +16,7 @@ from ._configuration import JsonClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import PropertyOperations +from .property.operations import PropertyOperations class JsonClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py index 560d2f21056..f088234847b 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..property.aio.operations import PropertyOperations from ._configuration import JsonClientConfiguration -from .operations import PropertyOperations class JsonClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py new file mode 100644 index 00000000000..22f11074013 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PropertyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PropertyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py similarity index 97% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py index 2d0183eece1..1e8a6208b73 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py @@ -27,10 +27,10 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from ...._model_base import SdkJSONEncoder, _deserialize +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import JsonClientConfiguration from ...operations._operations import build_property_get_request, build_property_send_request -from .._configuration import JsonClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/__init__.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py similarity index 95% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py index ee9a4c7d00a..0c3275c7389 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class JsonEncodedNameModel(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py new file mode 100644 index 00000000000..22f11074013 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import PropertyOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PropertyOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py index 81595014e1c..c1dbf782b27 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from .._configuration import JsonClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer +from ..._configuration import JsonClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py index 78b33183909..9f2ec6fe863 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "serialization-encodedname-json" +PACKAGE_NAMESPACE = "serialization.encodedname.json" PACKAGE_PPRINT_NAME = "Serialization Encodedname Json" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/MANIFEST.in b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/MANIFEST.in index 3fb7e5ef0a6..f1826052a5d 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/MANIFEST.in @@ -4,4 +4,4 @@ include server/endpoint/notdefined/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/endpoint/__init__.py \ No newline at end of file +include server/endpoint/__init__.py diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/README.md b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/README.md index a053ffb3406..fd6a68b7989 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/README.md +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/README.md @@ -1,5 +1,3 @@ - - # Server Endpoint Notdefined client library for Python @@ -17,6 +15,7 @@ python -m pip install server-endpoint-notdefined - You need an [Azure subscription][azure_sub] to use this package. - An existing Server Endpoint Notdefined instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py index e4626a83540..76611cc3812 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-endpoint-notdefined" +PACKAGE_NAMESPACE = "server.endpoint.notdefined" PACKAGE_PPRINT_NAME = "Server Endpoint Notdefined" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/MANIFEST.in b/packages/typespec-python/test/azure/generated/server-path-multiple/MANIFEST.in index 543f941fab6..56d253b0ae2 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/MANIFEST.in @@ -4,4 +4,4 @@ include server/path/multiple/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/path/__init__.py \ No newline at end of file +include server/path/__init__.py diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/README.md b/packages/typespec-python/test/azure/generated/server-path-multiple/README.md index dc1b26979d8..88e0cf0beef 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/README.md +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/README.md @@ -1,5 +1,3 @@ - - # Server Path Multiple client library for Python @@ -17,6 +15,7 @@ python -m pip install server-path-multiple - You need an [Azure subscription][azure_sub] to use this package. - An existing Server Path Multiple instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py b/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py index 094b0a2b9e0..85e6c12881e 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-path-multiple" +PACKAGE_NAMESPACE = "server.path.multiple" PACKAGE_PPRINT_NAME = "Server Path Multiple" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-path-single/MANIFEST.in b/packages/typespec-python/test/azure/generated/server-path-single/MANIFEST.in index 973c402a023..d3262e4af86 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/server-path-single/MANIFEST.in @@ -4,4 +4,4 @@ include server/path/single/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/path/__init__.py \ No newline at end of file +include server/path/__init__.py diff --git a/packages/typespec-python/test/azure/generated/server-path-single/README.md b/packages/typespec-python/test/azure/generated/server-path-single/README.md index 490f5929f58..860e102d8c8 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/README.md +++ b/packages/typespec-python/test/azure/generated/server-path-single/README.md @@ -1,5 +1,3 @@ - - # Server Path Single client library for Python @@ -17,6 +15,7 @@ python -m pip install server-path-single - You need an [Azure subscription][azure_sub] to use this package. - An existing Server Path Single instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/server-path-single/setup.py b/packages/typespec-python/test/azure/generated/server-path-single/setup.py index 953611cf578..e093522a3fe 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/setup.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-path-single" +PACKAGE_NAMESPACE = "server.path.single" PACKAGE_PPRINT_NAME = "Server Path Single" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/MANIFEST.in b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/MANIFEST.in index cb00091dc98..03251cbd03c 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/MANIFEST.in @@ -4,4 +4,4 @@ include server/versions/notversioned/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/versions/__init__.py \ No newline at end of file +include server/versions/__init__.py diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/README.md b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/README.md index ea4c5ee345a..d6e8fdf210a 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/README.md +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/README.md @@ -1,5 +1,3 @@ - - # Server Versions Notversioned client library for Python @@ -17,6 +15,7 @@ python -m pip install server-versions-notversioned - You need an [Azure subscription][azure_sub] to use this package. - An existing Server Versions Notversioned instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py index 41a48fd1dad..8e3aef03e59 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-versions-notversioned" +PACKAGE_NAMESPACE = "server.versions.notversioned" PACKAGE_PPRINT_NAME = "Server Versions Notversioned" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/MANIFEST.in b/packages/typespec-python/test/azure/generated/server-versions-versioned/MANIFEST.in index 7779034f76c..914710e6ed5 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/MANIFEST.in @@ -4,4 +4,4 @@ include server/versions/versioned/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/versions/__init__.py \ No newline at end of file +include server/versions/__init__.py diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/README.md b/packages/typespec-python/test/azure/generated/server-versions-versioned/README.md index ec3569014ae..c0c5ec55846 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/README.md +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/README.md @@ -1,5 +1,3 @@ - - # Server Versions Versioned client library for Python @@ -17,6 +15,7 @@ python -m pip install server-versions-versioned - You need an [Azure subscription][azure_sub] to use this package. - An existing Server Versions Versioned instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py index 5fa7ca626f7..c723585056e 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-versions-versioned" +PACKAGE_NAMESPACE = "server.versions.versioned" PACKAGE_PPRINT_NAME = "Server Versions Versioned" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/MANIFEST.in b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/MANIFEST.in index f9e928ca45b..fc707cbe7eb 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include specialheaders/conditionalrequest/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include specialheaders/__init__.py \ No newline at end of file +include specialheaders/__init__.py diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/README.md b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/README.md index 30e1ebc66bc..d1ecdd7f72e 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/README.md +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/README.md @@ -1,5 +1,3 @@ - - # Specialheaders Conditionalrequest client library for Python @@ -17,6 +15,7 @@ python -m pip install specialheaders-conditionalrequest - You need an [Azure subscription][azure_sub] to use this package. - An existing Specialheaders Conditionalrequest instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py index 9c3678798fe..aa6b8af3bbd 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialheaders-conditionalrequest" +PACKAGE_NAMESPACE = "specialheaders.conditionalrequest" PACKAGE_PPRINT_NAME = "Specialheaders Conditionalrequest" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/MANIFEST.in b/packages/typespec-python/test/azure/generated/special-headers-repeatability/MANIFEST.in index 237a98837bc..e7e275be2ba 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include specialheaders/repeatability/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include specialheaders/__init__.py \ No newline at end of file +include specialheaders/__init__.py diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/README.md b/packages/typespec-python/test/azure/generated/special-headers-repeatability/README.md index 6447c0a79a2..b976370d314 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/README.md +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/README.md @@ -1,5 +1,3 @@ - - # Specialheaders Repeatability client library for Python @@ -17,6 +15,7 @@ python -m pip install specialheaders-repeatability - You need an [Azure subscription][azure_sub] to use this package. - An existing Specialheaders Repeatability instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py b/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py index 9f8a19484bc..3c9ef0b38eb 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialheaders-repeatability" +PACKAGE_NAMESPACE = "specialheaders.repeatability" PACKAGE_PPRINT_NAME = "Specialheaders Repeatability" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-words/MANIFEST.in b/packages/typespec-python/test/azure/generated/special-words/MANIFEST.in index fa4fcb28a3e..0bd139fa00a 100644 --- a/packages/typespec-python/test/azure/generated/special-words/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/special-words/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include specialwords/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/azure/generated/special-words/README.md b/packages/typespec-python/test/azure/generated/special-words/README.md index 2c5ffef5df8..438fed85ba0 100644 --- a/packages/typespec-python/test/azure/generated/special-words/README.md +++ b/packages/typespec-python/test/azure/generated/special-words/README.md @@ -1,5 +1,3 @@ - - # Specialwords client library for Python @@ -17,6 +15,7 @@ python -m pip install specialwords - You need an [Azure subscription][azure_sub] to use this package. - An existing Specialwords instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json b/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json index 0e31f4ac4f0..ee042fc9299 100644 --- a/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json @@ -1,40 +1,40 @@ { "CrossLanguagePackageId": "SpecialWords", "CrossLanguageDefinitionId": { - "specialwords.models.AndModel": "SpecialWords.Models.and", - "specialwords.models.AsModel": "SpecialWords.Models.as", - "specialwords.models.AssertModel": "SpecialWords.Models.assert", - "specialwords.models.AsyncModel": "SpecialWords.Models.async", - "specialwords.models.AwaitModel": "SpecialWords.Models.await", - "specialwords.models.BreakModel": "SpecialWords.Models.break", - "specialwords.models.ClassModel": "SpecialWords.Models.class", - "specialwords.models.Constructor": "SpecialWords.Models.constructor", - "specialwords.models.ContinueModel": "SpecialWords.Models.continue", - "specialwords.models.DefModel": "SpecialWords.Models.def", - "specialwords.models.DelModel": "SpecialWords.Models.del", - "specialwords.models.ElifModel": "SpecialWords.Models.elif", - "specialwords.models.ElseModel": "SpecialWords.Models.else", - "specialwords.models.ExceptModel": "SpecialWords.Models.except", - "specialwords.models.ExecModel": "SpecialWords.Models.exec", - "specialwords.models.FinallyModel": "SpecialWords.Models.finally", - "specialwords.models.ForModel": "SpecialWords.Models.for", - "specialwords.models.FromModel": "SpecialWords.Models.from", - "specialwords.models.GlobalModel": "SpecialWords.Models.global", - "specialwords.models.IfModel": "SpecialWords.Models.if", - "specialwords.models.ImportModel": "SpecialWords.Models.import", - "specialwords.models.InModel": "SpecialWords.Models.in", - "specialwords.models.IsModel": "SpecialWords.Models.is", - "specialwords.models.LambdaModel": "SpecialWords.Models.lambda", - "specialwords.models.NotModel": "SpecialWords.Models.not", - "specialwords.models.OrModel": "SpecialWords.Models.or", - "specialwords.models.PassModel": "SpecialWords.Models.pass", - "specialwords.models.RaiseModel": "SpecialWords.Models.raise", - "specialwords.models.ReturnModel": "SpecialWords.Models.return", - "specialwords.models.SameAsModel": "SpecialWords.ModelProperties.SameAsModel", - "specialwords.models.TryModel": "SpecialWords.Models.try", - "specialwords.models.WhileModel": "SpecialWords.Models.while", - "specialwords.models.WithModel": "SpecialWords.Models.with", - "specialwords.models.YieldModel": "SpecialWords.Models.yield", + "specialwords.models.models.AndModel": "SpecialWords.Models.and", + "specialwords.models.models.AsModel": "SpecialWords.Models.as", + "specialwords.models.models.AssertModel": "SpecialWords.Models.assert", + "specialwords.models.models.AsyncModel": "SpecialWords.Models.async", + "specialwords.models.models.AwaitModel": "SpecialWords.Models.await", + "specialwords.models.models.BreakModel": "SpecialWords.Models.break", + "specialwords.models.models.ClassModel": "SpecialWords.Models.class", + "specialwords.models.models.Constructor": "SpecialWords.Models.constructor", + "specialwords.models.models.ContinueModel": "SpecialWords.Models.continue", + "specialwords.models.models.DefModel": "SpecialWords.Models.def", + "specialwords.models.models.DelModel": "SpecialWords.Models.del", + "specialwords.models.models.ElifModel": "SpecialWords.Models.elif", + "specialwords.models.models.ElseModel": "SpecialWords.Models.else", + "specialwords.models.models.ExceptModel": "SpecialWords.Models.except", + "specialwords.models.models.ExecModel": "SpecialWords.Models.exec", + "specialwords.models.models.FinallyModel": "SpecialWords.Models.finally", + "specialwords.models.models.ForModel": "SpecialWords.Models.for", + "specialwords.models.models.FromModel": "SpecialWords.Models.from", + "specialwords.models.models.GlobalModel": "SpecialWords.Models.global", + "specialwords.models.models.IfModel": "SpecialWords.Models.if", + "specialwords.models.models.ImportModel": "SpecialWords.Models.import", + "specialwords.models.models.InModel": "SpecialWords.Models.in", + "specialwords.models.models.IsModel": "SpecialWords.Models.is", + "specialwords.models.models.LambdaModel": "SpecialWords.Models.lambda", + "specialwords.models.models.NotModel": "SpecialWords.Models.not", + "specialwords.models.models.OrModel": "SpecialWords.Models.or", + "specialwords.models.models.PassModel": "SpecialWords.Models.pass", + "specialwords.models.models.RaiseModel": "SpecialWords.Models.raise", + "specialwords.models.models.ReturnModel": "SpecialWords.Models.return", + "specialwords.modelproperties.models.SameAsModel": "SpecialWords.ModelProperties.SameAsModel", + "specialwords.models.models.TryModel": "SpecialWords.Models.try", + "specialwords.models.models.WhileModel": "SpecialWords.Models.while", + "specialwords.models.models.WithModel": "SpecialWords.Models.with", + "specialwords.models.models.YieldModel": "SpecialWords.Models.yield", "specialwords.SpecialWordsClient.models.with_and": "SpecialWords.Models.withAnd", "specialwords.SpecialWordsClient.models.with_as": "SpecialWords.Models.withAs", "specialwords.SpecialWordsClient.models.with_assert": "SpecialWords.Models.withAssert", diff --git a/packages/typespec-python/test/azure/generated/special-words/setup.py b/packages/typespec-python/test/azure/generated/special-words/setup.py index adeea4c3559..f5e41449cdd 100644 --- a/packages/typespec-python/test/azure/generated/special-words/setup.py +++ b/packages/typespec-python/test/azure/generated/special-words/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialwords" +PACKAGE_NAMESPACE = "specialwords" PACKAGE_PPRINT_NAME = "Specialwords" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py index e999f31bbec..41b05891176 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py @@ -16,7 +16,9 @@ from ._configuration import SpecialWordsClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import ModelPropertiesOperations, ModelsOperations, Operations, ParametersOperations +from .modelproperties.operations import ModelPropertiesOperations +from .models.operations import ModelsOperations +from .operations import Operations, ParametersOperations class SpecialWordsClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py index 4d9f8a5e9f4..7f246800020 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py @@ -15,8 +15,10 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..modelproperties.aio.operations import ModelPropertiesOperations +from ..models.aio.operations import ModelsOperations from ._configuration import SpecialWordsClientConfiguration -from .operations import ModelPropertiesOperations, ModelsOperations, Operations, ParametersOperations +from .operations import Operations, ParametersOperations class SpecialWordsClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py index b4802a9d551..05cd579e07d 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ModelsOperations # type: ignore -from ._operations import ModelPropertiesOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ParametersOperations # type: ignore @@ -22,8 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ModelsOperations", - "ModelPropertiesOperations", "Operations", "ParametersOperations", ] diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py index ab6664afc82..e8343dfd4bb 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py @@ -6,10 +6,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from io import IOBase -import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -23,46 +21,9 @@ from azure.core.pipeline import PipelineResponse from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from ... import models as _models -from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer from ...operations._operations import ( - build_model_properties_same_as_model_request, - build_models_with_and_request, - build_models_with_as_request, - build_models_with_assert_request, - build_models_with_async_request, - build_models_with_await_request, - build_models_with_break_request, - build_models_with_class_request, - build_models_with_constructor_request, - build_models_with_continue_request, - build_models_with_def_request, - build_models_with_del_request, - build_models_with_elif_request, - build_models_with_else_request, - build_models_with_except_request, - build_models_with_exec_request, - build_models_with_finally_request, - build_models_with_for_request, - build_models_with_from_request, - build_models_with_global_request, - build_models_with_if_request, - build_models_with_import_request, - build_models_with_in_request, - build_models_with_is_request, - build_models_with_lambda_request, - build_models_with_not_request, - build_models_with_or_request, - build_models_with_pass_request, - build_models_with_raise_request, - build_models_with_return_request, - build_models_with_try_request, - build_models_with_while_request, - build_models_with_with_request, - build_models_with_yield_request, build_operations_and_method_request, build_operations_as_method_request, build_operations_assert_method_request, @@ -137,3425 +98,10 @@ from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ModelsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.aio.SpecialWordsClient`'s - :attr:`models` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: ~specialwords.models.AndModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_and. - - :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AndModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_and_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: ~specialwords.models.AsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_as. - - :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_as_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_assert( - self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_assert. - - :param body: Required. - :type body: ~specialwords.models.AssertModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_assert. - - :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_assert_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_async( - self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_async. - - :param body: Required. - :type body: ~specialwords.models.AsyncModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_async. - - :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_async_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_await( - self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_await. - - :param body: Required. - :type body: ~specialwords.models.AwaitModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_await. - - :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_await_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_break( - self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_break. - - :param body: Required. - :type body: ~specialwords.models.BreakModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_break. - - :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_break_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_class( - self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_class. - - :param body: Required. - :type body: ~specialwords.models.ClassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_class. - - :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_class_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Required. - :type body: ~specialwords.models.Constructor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_constructor. - - :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. - :type body: ~specialwords.models.Constructor or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_constructor_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_continue. - - :param body: Required. - :type body: ~specialwords.models.ContinueModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_continue. - - :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_continue_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: ~specialwords.models.DefModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_def. - - :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DefModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_def_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: ~specialwords.models.DelModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_del. - - :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DelModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_del_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_elif( - self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_elif. - - :param body: Required. - :type body: ~specialwords.models.ElifModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_elif. - - :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_elif_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_else( - self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_else. - - :param body: Required. - :type body: ~specialwords.models.ElseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_else. - - :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_else_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_except( - self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_except. - - :param body: Required. - :type body: ~specialwords.models.ExceptModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_except. - - :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_except_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_exec( - self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_exec. - - :param body: Required. - :type body: ~specialwords.models.ExecModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_exec. - - :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_exec_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_finally. - - :param body: Required. - :type body: ~specialwords.models.FinallyModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_finally. - - :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_finally_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: ~specialwords.models.ForModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_for. - - :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ForModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_for_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_from( - self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_from. - - :param body: Required. - :type body: ~specialwords.models.FromModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_from. - - :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FromModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_from_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_global( - self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_global. - - :param body: Required. - :type body: ~specialwords.models.GlobalModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_global. - - :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_global_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: ~specialwords.models.IfModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_if. - - :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IfModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_if_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_import( - self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_import. - - :param body: Required. - :type body: ~specialwords.models.ImportModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_import. - - :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_import_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: ~specialwords.models.InModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_in. - - :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.InModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_in_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: ~specialwords.models.IsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_is. - - :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_is_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_lambda( - self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_lambda. - - :param body: Required. - :type body: ~specialwords.models.LambdaModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_lambda. - - :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_lambda_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: ~specialwords.models.NotModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_not. - - :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.NotModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_not_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: ~specialwords.models.OrModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_or. - - :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.OrModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_or_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_pass( - self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_pass. - - :param body: Required. - :type body: ~specialwords.models.PassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_pass. - - :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.PassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_pass_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_raise( - self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_raise. - - :param body: Required. - :type body: ~specialwords.models.RaiseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_raise. - - :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_raise_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_return( - self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_return. - - :param body: Required. - :type body: ~specialwords.models.ReturnModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_return. - - :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_return_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: ~specialwords.models.TryModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_try. - - :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.TryModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_try_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_while( - self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_while. - - :param body: Required. - :type body: ~specialwords.models.WhileModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_while. - - :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_while_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_with( - self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_with. - - :param body: Required. - :type body: ~specialwords.models.WithModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_with. - - :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WithModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_with_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_yield( - self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_yield. - - :param body: Required. - :type body: ~specialwords.models.YieldModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_yield. - - :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_yield_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ModelPropertiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.aio.SpecialWordsClient`'s - :attr:`model_properties` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Required. - :type body: ~specialwords.models.SameAsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """same_as_model. - - :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_properties_same_as_model_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class Operations: # pylint: disable=too-many-public-methods """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py new file mode 100644 index 00000000000..3f2526afc60 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelPropertiesOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelPropertiesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py new file mode 100644 index 00000000000..a4a5b1a4890 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py @@ -0,0 +1,157 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import SpecialWordsClientConfiguration +from ...operations._operations import build_model_properties_same_as_model_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ModelPropertiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.aio.SpecialWordsClient`'s + :attr:`model_properties` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def same_as_model( + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Required. + :type body: ~specialwords.models.SameAsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """same_as_model. + + :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_properties_same_as_model_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py new file mode 100644 index 00000000000..842d670d275 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + SameAsModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "SameAsModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py new file mode 100644 index 00000000000..5a3ac06c36c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field + + +class SameAsModel(_model_base.Model): + """SameAsModel. + + :ivar same_as_model: Required. + :vartype same_as_model: str + """ + + same_as_model: str = rest_field(name="SameAsModel", visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + same_as_model: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py new file mode 100644 index 00000000000..3f2526afc60 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelPropertiesOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelPropertiesOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py new file mode 100644 index 00000000000..bc7afa8da2c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py @@ -0,0 +1,175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import SpecialWordsClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_model_properties_same_as_model_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/model-properties/same-as-model" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class ModelPropertiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.SpecialWordsClient`'s + :attr:`model_properties` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def same_as_model( + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Required. + :type body: ~specialwords.models.SameAsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def same_as_model( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_properties_same_as_model_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py index c7efcf1f285..d55ccad1f57 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py @@ -1,93 +1 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - AndModel, - AsModel, - AssertModel, - AsyncModel, - AwaitModel, - BreakModel, - ClassModel, - Constructor, - ContinueModel, - DefModel, - DelModel, - ElifModel, - ElseModel, - ExceptModel, - ExecModel, - FinallyModel, - ForModel, - FromModel, - GlobalModel, - IfModel, - ImportModel, - InModel, - IsModel, - LambdaModel, - NotModel, - OrModel, - PassModel, - RaiseModel, - ReturnModel, - SameAsModel, - TryModel, - WhileModel, - WithModel, - YieldModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AndModel", - "AsModel", - "AssertModel", - "AsyncModel", - "AwaitModel", - "BreakModel", - "ClassModel", - "Constructor", - "ContinueModel", - "DefModel", - "DelModel", - "ElifModel", - "ElseModel", - "ExceptModel", - "ExecModel", - "FinallyModel", - "ForModel", - "FromModel", - "GlobalModel", - "IfModel", - "ImportModel", - "InModel", - "IsModel", - "LambdaModel", - "NotModel", - "OrModel", - "PassModel", - "RaiseModel", - "ReturnModel", - "SameAsModel", - "TryModel", - "WhileModel", - "WithModel", - "YieldModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py new file mode 100644 index 00000000000..5c69707d769 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py new file mode 100644 index 00000000000..64d9253dc91 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py @@ -0,0 +1,3370 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ...._model_base import SdkJSONEncoder +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import SpecialWordsClientConfiguration +from ...operations._operations import ( + build_models_with_and_request, + build_models_with_as_request, + build_models_with_assert_request, + build_models_with_async_request, + build_models_with_await_request, + build_models_with_break_request, + build_models_with_class_request, + build_models_with_constructor_request, + build_models_with_continue_request, + build_models_with_def_request, + build_models_with_del_request, + build_models_with_elif_request, + build_models_with_else_request, + build_models_with_except_request, + build_models_with_exec_request, + build_models_with_finally_request, + build_models_with_for_request, + build_models_with_from_request, + build_models_with_global_request, + build_models_with_if_request, + build_models_with_import_request, + build_models_with_in_request, + build_models_with_is_request, + build_models_with_lambda_request, + build_models_with_not_request, + build_models_with_or_request, + build_models_with_pass_request, + build_models_with_raise_request, + build_models_with_return_request, + build_models_with_try_request, + build_models_with_while_request, + build_models_with_with_request, + build_models_with_yield_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ModelsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.aio.SpecialWordsClient`'s + :attr:`models` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: ~specialwords.models.AndModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_and. + + :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AndModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_and_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: ~specialwords.models.AsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_as. + + :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_as_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_assert( + self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_assert. + + :param body: Required. + :type body: ~specialwords.models.AssertModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_assert. + + :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_assert_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_async( + self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_async. + + :param body: Required. + :type body: ~specialwords.models.AsyncModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_async. + + :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_async_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_await( + self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_await. + + :param body: Required. + :type body: ~specialwords.models.AwaitModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_await. + + :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_await_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_break( + self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_break. + + :param body: Required. + :type body: ~specialwords.models.BreakModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_break. + + :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_break_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_class( + self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_class. + + :param body: Required. + :type body: ~specialwords.models.ClassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_class. + + :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_class_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_constructor( + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Required. + :type body: ~specialwords.models.Constructor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_constructor. + + :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. + :type body: ~specialwords.models.Constructor or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_constructor_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_continue( + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_continue. + + :param body: Required. + :type body: ~specialwords.models.ContinueModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_continue. + + :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_continue_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: ~specialwords.models.DefModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_def. + + :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DefModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_def_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: ~specialwords.models.DelModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_del. + + :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DelModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_del_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_elif( + self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_elif. + + :param body: Required. + :type body: ~specialwords.models.ElifModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_elif. + + :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_elif_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_else( + self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_else. + + :param body: Required. + :type body: ~specialwords.models.ElseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_else. + + :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_else_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_except( + self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_except. + + :param body: Required. + :type body: ~specialwords.models.ExceptModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_except. + + :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_except_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_exec( + self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_exec. + + :param body: Required. + :type body: ~specialwords.models.ExecModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_exec. + + :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_exec_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_finally( + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_finally. + + :param body: Required. + :type body: ~specialwords.models.FinallyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_finally. + + :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_finally_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: ~specialwords.models.ForModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_for. + + :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ForModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_for_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_from( + self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_from. + + :param body: Required. + :type body: ~specialwords.models.FromModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_from. + + :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FromModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_from_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_global( + self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_global. + + :param body: Required. + :type body: ~specialwords.models.GlobalModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_global. + + :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_global_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: ~specialwords.models.IfModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_if. + + :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IfModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_if_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_import( + self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_import. + + :param body: Required. + :type body: ~specialwords.models.ImportModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_import. + + :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_import_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: ~specialwords.models.InModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_in. + + :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.InModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_in_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: ~specialwords.models.IsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_is. + + :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_is_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_lambda( + self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_lambda. + + :param body: Required. + :type body: ~specialwords.models.LambdaModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_lambda. + + :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_lambda_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: ~specialwords.models.NotModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_not. + + :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.NotModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_not_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: ~specialwords.models.OrModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_or. + + :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.OrModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_or_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_pass( + self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_pass. + + :param body: Required. + :type body: ~specialwords.models.PassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_pass. + + :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.PassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_pass_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_raise( + self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_raise. + + :param body: Required. + :type body: ~specialwords.models.RaiseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_raise. + + :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_raise_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_return( + self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_return. + + :param body: Required. + :type body: ~specialwords.models.ReturnModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_return. + + :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_return_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: ~specialwords.models.TryModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_try. + + :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.TryModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_try_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_while( + self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_while. + + :param body: Required. + :type body: ~specialwords.models.WhileModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_while. + + :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_while_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_with( + self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_with. + + :param body: Required. + :type body: ~specialwords.models.WithModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_with. + + :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WithModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_with_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_yield( + self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_yield. + + :param body: Required. + :type body: ~specialwords.models.YieldModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_yield. + + :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_yield_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py new file mode 100644 index 00000000000..77bc8025644 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AndModel, + AsModel, + AssertModel, + AsyncModel, + AwaitModel, + BreakModel, + ClassModel, + Constructor, + ContinueModel, + DefModel, + DelModel, + ElifModel, + ElseModel, + ExceptModel, + ExecModel, + FinallyModel, + ForModel, + FromModel, + GlobalModel, + IfModel, + ImportModel, + InModel, + IsModel, + LambdaModel, + NotModel, + OrModel, + PassModel, + RaiseModel, + ReturnModel, + TryModel, + WhileModel, + WithModel, + YieldModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AndModel", + "AsModel", + "AssertModel", + "AsyncModel", + "AwaitModel", + "BreakModel", + "ClassModel", + "Constructor", + "ContinueModel", + "DefModel", + "DelModel", + "ElifModel", + "ElseModel", + "ExceptModel", + "ExecModel", + "FinallyModel", + "ForModel", + "FromModel", + "GlobalModel", + "IfModel", + "ImportModel", + "InModel", + "IsModel", + "LambdaModel", + "NotModel", + "OrModel", + "PassModel", + "RaiseModel", + "ReturnModel", + "TryModel", + "WhileModel", + "WithModel", + "YieldModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py similarity index 96% rename from packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py rename to packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py index 57c90b789f4..5f9bcdf06ce 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from .. import _model_base -from .._model_base import rest_field +from ... import _model_base +from ..._model_base import rest_field class AndModel(_model_base.Model): @@ -825,34 +825,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SameAsModel(_model_base.Model): - """SameAsModel. - - :ivar same_as_model: Required. - :vartype same_as_model: str - """ - - same_as_model: str = rest_field(name="SameAsModel", visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - same_as_model: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class TryModel(_model_base.Model): """TryModel. diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py new file mode 100644 index 00000000000..5c69707d769 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ModelsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ModelsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py new file mode 100644 index 00000000000..6b5a6f25d47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py @@ -0,0 +1,3828 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from ..._configuration import SpecialWordsClientConfiguration +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_models_with_and_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/and" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_as_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/as" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_assert_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/assert" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_async_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/async" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_await_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/await" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_break_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/break" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_class_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/class" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_constructor_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/constructor" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_continue_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/continue" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_def_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/def" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_del_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/del" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_elif_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/elif" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_else_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/else" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_except_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/except" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_exec_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/exec" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_finally_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/finally" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_for_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/for" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_from_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/from" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_global_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/global" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_if_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/if" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_import_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/import" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_in_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/in" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_is_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/is" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_lambda_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/lambda" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_not_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/not" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_or_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/or" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_pass_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/pass" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_raise_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/raise" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_return_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/return" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_try_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/try" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_while_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/while" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_with_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/with" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_yield_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/yield" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +class ModelsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.SpecialWordsClient`'s + :attr:`models` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: ~specialwords.models.AndModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_and( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_and. + + :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AndModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_and_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: ~specialwords.models.AsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_as( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_as. + + :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_as_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: ~specialwords.models.AssertModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_assert( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_assert. + + :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_assert_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: ~specialwords.models.AsyncModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_async( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_async. + + :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_async_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: ~specialwords.models.AwaitModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_await( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_await. + + :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_await_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: ~specialwords.models.BreakModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_break( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_break. + + :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_break_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: ~specialwords.models.ClassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_class( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_class. + + :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_class_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_constructor( + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Required. + :type body: ~specialwords.models.Constructor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_constructor( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. + :type body: ~specialwords.models.Constructor or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_constructor_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_continue( + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_continue. + + :param body: Required. + :type body: ~specialwords.models.ContinueModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_continue( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_continue. + + :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_continue_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: ~specialwords.models.DefModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_def( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_def. + + :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DefModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_def_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: ~specialwords.models.DelModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_del( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_del. + + :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DelModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_del_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: ~specialwords.models.ElifModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_elif( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_elif. + + :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_elif_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: ~specialwords.models.ElseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_else( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_else. + + :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_else_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: ~specialwords.models.ExceptModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_except( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_except. + + :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_except_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: ~specialwords.models.ExecModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_exec( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_exec. + + :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_exec_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_finally( + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_finally. + + :param body: Required. + :type body: ~specialwords.models.FinallyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_finally( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_finally. + + :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_finally_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: ~specialwords.models.ForModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_for( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_for. + + :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ForModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_for_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: ~specialwords.models.FromModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_from( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_from. + + :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FromModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_from_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: ~specialwords.models.GlobalModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_global( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_global. + + :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_global_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: ~specialwords.models.IfModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_if( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_if. + + :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IfModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_if_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: ~specialwords.models.ImportModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_import( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_import. + + :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_import_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: ~specialwords.models.InModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_in( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_in. + + :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.InModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_in_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: ~specialwords.models.IsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_is( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_is. + + :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_is_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: ~specialwords.models.LambdaModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_lambda( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_lambda. + + :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_lambda_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: ~specialwords.models.NotModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_not( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_not. + + :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.NotModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_not_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: ~specialwords.models.OrModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_or( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_or. + + :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.OrModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_or_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: ~specialwords.models.PassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_pass( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_pass. + + :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.PassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_pass_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: ~specialwords.models.RaiseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_raise( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_raise. + + :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_raise_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: ~specialwords.models.ReturnModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_return( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_return. + + :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_return_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: ~specialwords.models.TryModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_try( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_try. + + :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.TryModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_try_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: ~specialwords.models.WhileModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_while( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_while. + + :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_while_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: ~specialwords.models.WithModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_with( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_with. + + :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WithModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_with_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: ~specialwords.models.YieldModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_yield( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_yield. + + :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_yield_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py index b4802a9d551..05cd579e07d 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import ModelsOperations # type: ignore -from ._operations import ModelPropertiesOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ParametersOperations # type: ignore @@ -22,8 +20,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ModelsOperations", - "ModelPropertiesOperations", "Operations", "ParametersOperations", ] diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py index 052a07ae1f7..6749aa3a22c 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py @@ -6,10 +6,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from io import IOBase -import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -25,16 +23,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models from .._configuration import SpecialWordsClientConfiguration -from .._model_base import SdkJSONEncoder from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,482 +37,6 @@ _SERIALIZER.client_side_validation = False -def build_models_with_and_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/and" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_as_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/as" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_assert_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/assert" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_async_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/async" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_await_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/await" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_break_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/break" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_class_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/class" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_constructor_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/constructor" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_continue_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/continue" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_def_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/def" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_del_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/del" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_elif_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/elif" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_else_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/else" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_except_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/except" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_exec_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/exec" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_finally_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/finally" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_for_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/for" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_from_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/from" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_global_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/global" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_if_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/if" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_import_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/import" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_in_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/in" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_is_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/is" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_lambda_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/lambda" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_not_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/not" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_or_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/or" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_pass_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/pass" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_raise_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/raise" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_return_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/return" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_try_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/try" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_while_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/while" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_with_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/with" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_yield_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/yield" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_model_properties_same_as_model_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/model-properties/same-as-model" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - def build_operations_and_method_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/special-words/operations/and" @@ -1161,3450 +680,6 @@ def build_parameters_with_cancellation_token_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, **kwargs) -class ModelsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.SpecialWordsClient`'s - :attr:`models` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: ~specialwords.models.AndModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_and( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_and. - - :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AndModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_and_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: ~specialwords.models.AsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_as( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_as. - - :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_as_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: ~specialwords.models.AssertModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_assert( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_assert. - - :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_assert_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: ~specialwords.models.AsyncModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_async( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_async. - - :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_async_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: ~specialwords.models.AwaitModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_await( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_await. - - :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_await_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: ~specialwords.models.BreakModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_break( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_break. - - :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_break_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: ~specialwords.models.ClassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_class( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_class. - - :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_class_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Required. - :type body: ~specialwords.models.Constructor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_constructor( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. - :type body: ~specialwords.models.Constructor or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_constructor_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_continue. - - :param body: Required. - :type body: ~specialwords.models.ContinueModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_continue( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_continue. - - :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_continue_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: ~specialwords.models.DefModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_def( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_def. - - :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DefModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_def_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: ~specialwords.models.DelModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_del( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_del. - - :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DelModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_del_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: ~specialwords.models.ElifModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_elif( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_elif. - - :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_elif_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: ~specialwords.models.ElseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_else( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_else. - - :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_else_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: ~specialwords.models.ExceptModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_except( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_except. - - :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_except_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: ~specialwords.models.ExecModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_exec( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_exec. - - :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_exec_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_finally. - - :param body: Required. - :type body: ~specialwords.models.FinallyModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_finally( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_finally. - - :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_finally_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: ~specialwords.models.ForModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_for( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_for. - - :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ForModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_for_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: ~specialwords.models.FromModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_from( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_from. - - :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FromModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_from_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: ~specialwords.models.GlobalModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_global( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_global. - - :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_global_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: ~specialwords.models.IfModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_if( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_if. - - :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IfModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_if_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: ~specialwords.models.ImportModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_import( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_import. - - :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_import_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: ~specialwords.models.InModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_in( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_in. - - :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.InModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_in_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: ~specialwords.models.IsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_is( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_is. - - :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_is_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: ~specialwords.models.LambdaModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_lambda( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_lambda. - - :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_lambda_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: ~specialwords.models.NotModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_not( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_not. - - :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.NotModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_not_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: ~specialwords.models.OrModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_or( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_or. - - :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.OrModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_or_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: ~specialwords.models.PassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_pass( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_pass. - - :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.PassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_pass_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: ~specialwords.models.RaiseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_raise( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_raise. - - :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_raise_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: ~specialwords.models.ReturnModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_return( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_return. - - :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_return_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: ~specialwords.models.TryModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_try( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_try. - - :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.TryModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_try_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: ~specialwords.models.WhileModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_while( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_while. - - :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_while_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: ~specialwords.models.WithModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_with( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_with. - - :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WithModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_with_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: ~specialwords.models.YieldModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_yield( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_yield. - - :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_yield_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ModelPropertiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.SpecialWordsClient`'s - :attr:`model_properties` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Required. - :type body: ~specialwords.models.SameAsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def same_as_model( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_properties_same_as_model_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - class Operations: # pylint: disable=too-many-public-methods """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/typetest-array/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-array/MANIFEST.in index a465968cb1a..23611f20002 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-array/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/array/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-array/README.md b/packages/typespec-python/test/azure/generated/typetest-array/README.md index 00b81ac15b3..858a45c77c0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-array/README.md @@ -1,5 +1,3 @@ - - # Typetest Array client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-array - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Array instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-array/setup.py b/packages/typespec-python/test/azure/generated/typetest-array/setup.py index 2ff11c984f4..94c929aac58 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-array" +PACKAGE_NAMESPACE = "typetest.array" PACKAGE_PPRINT_NAME = "Typetest Array" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-dictionary/MANIFEST.in index 2194c3bd9fe..8d989eb529c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/dictionary/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/README.md b/packages/typespec-python/test/azure/generated/typetest-dictionary/README.md index b7876ea14b8..2f9cf4db3ae 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/README.md @@ -1,5 +1,3 @@ - - # Typetest Dictionary client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-dictionary - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Dictionary instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py index 4bd20841a29..0ae820235c5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-dictionary" +PACKAGE_NAMESPACE = "typetest.dictionary" PACKAGE_PPRINT_NAME = "Typetest Dictionary" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/MANIFEST.in index cadf7e31a1b..51fb6ca25f7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/enum/extensible/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/enum/__init__.py \ No newline at end of file +include typetest/enum/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/README.md b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/README.md index 646a8c3ec3e..732d1bc3e71 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/README.md @@ -1,5 +1,3 @@ - - # Typetest Enum Extensible client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-enum-extensible - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Enum Extensible instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py index 6c4a0721453..794040c67e0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-enum-extensible" +PACKAGE_NAMESPACE = "typetest.enum.extensible" PACKAGE_PPRINT_NAME = "Typetest Enum Extensible" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/MANIFEST.in index b60b55cdab3..577b197e8e9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/enum/fixed/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/enum/__init__.py \ No newline at end of file +include typetest/enum/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/README.md b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/README.md index 4d463d20813..5013ea1e666 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/README.md @@ -1,5 +1,3 @@ - - # Typetest Enum Fixed client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-enum-fixed - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Enum Fixed instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py index 7deef5c1f89..b5d90bbce3f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-enum-fixed" +PACKAGE_NAMESPACE = "typetest.enum.fixed" PACKAGE_PPRINT_NAME = "Typetest Enum Fixed" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-empty/MANIFEST.in index 79c41726e37..5cd1e0e87ab 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/empty/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/README.md b/packages/typespec-python/test/azure/generated/typetest-model-empty/README.md index 13436f53ae1..97abe628bd4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Empty client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-empty - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Empty instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py index 98432ab7fc8..3247f6e9ae4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-empty" +PACKAGE_NAMESPACE = "typetest.model.empty" PACKAGE_PPRINT_NAME = "Typetest Model Empty" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/MANIFEST.in index a755cad0130..c88f38a9557 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/enumdiscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/README.md b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/README.md index b5a04356ccb..87136d34e9f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Enumdiscriminator client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-enumdiscriminator - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Enumdiscriminator instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py index 3613964eea5..9a4c15ddc19 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-enumdiscriminator" +PACKAGE_NAMESPACE = "typetest.model.enumdiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Enumdiscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/MANIFEST.in index b555114e4a7..8a9c735394b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/nesteddiscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/README.md b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/README.md index 147aba5cdf9..7eecaa524f6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Nesteddiscriminator client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-nesteddiscriminator - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Nesteddiscriminator instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py index 0c608caa988..aca3374855f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-nesteddiscriminator" +PACKAGE_NAMESPACE = "typetest.model.nesteddiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Nesteddiscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/MANIFEST.in index 16b644339ea..47fc2574304 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/notdiscriminated/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/README.md b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/README.md index 215be22d431..9b457baac4b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Notdiscriminated client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-notdiscriminated - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Notdiscriminated instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py index 15bd3750372..a641f10a4aa 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-notdiscriminated" +PACKAGE_NAMESPACE = "typetest.model.notdiscriminated" PACKAGE_PPRINT_NAME = "Typetest Model Notdiscriminated" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-recursive/MANIFEST.in index 2d44c39bf33..95276adaa97 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/recursive/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/README.md b/packages/typespec-python/test/azure/generated/typetest-model-recursive/README.md index 87540174157..3c740b4ead1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Recursive client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-recursive - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Recursive instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py index bfd4bf8ac4b..52061515112 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-recursive" +PACKAGE_NAMESPACE = "typetest.model.recursive" PACKAGE_PPRINT_NAME = "Typetest Model Recursive" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/MANIFEST.in index 0eab23be467..2cea11d5ea8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/singlediscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/README.md b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/README.md index 1389647f068..6d69db5c472 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Singlediscriminator client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-singlediscriminator - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Singlediscriminator instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py index cc844eb277f..209fb736353 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-singlediscriminator" +PACKAGE_NAMESPACE = "typetest.model.singlediscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Singlediscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-usage/MANIFEST.in index 47ea6680c9a..d042ddbf08c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/usage/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/README.md b/packages/typespec-python/test/azure/generated/typetest-model-usage/README.md index fae75217c80..35c9cb5c356 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Usage client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-usage - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Usage instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py index 7fc98fdb622..160e3a7e0e8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-usage" +PACKAGE_NAMESPACE = "typetest.model.usage" PACKAGE_PPRINT_NAME = "Typetest Model Usage" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-model-visibility/MANIFEST.in index 23933c60348..13cad0d7ff6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/visibility/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/README.md b/packages/typespec-python/test/azure/generated/typetest-model-visibility/README.md index dab0204dd64..d7f5644daaf 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/README.md @@ -1,5 +1,3 @@ - - # Typetest Model Visibility client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-model-visibility - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Model Visibility instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py index a4ea73fc4f4..a155cc400b5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-visibility" +PACKAGE_NAMESPACE = "typetest.model.visibility" PACKAGE_PPRINT_NAME = "Typetest Model Visibility" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/MANIFEST.in index 57dd89e3dbe..f336dd88dac 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/additionalproperties/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/README.md b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/README.md index 25d305a17d6..8eaa1c29b60 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/README.md @@ -1,5 +1,3 @@ - - # Typetest Property Additionalproperties client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-property-additionalproperties - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Property Additionalproperties instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py index 4c63f3e77f9..bc3163f7297 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-additionalproperties" +PACKAGE_NAMESPACE = "typetest.property.additionalproperties" PACKAGE_PPRINT_NAME = "Typetest Property Additionalproperties" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-property-nullable/MANIFEST.in index a0b21fd6e5b..9c6af5b254e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/nullable/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/README.md b/packages/typespec-python/test/azure/generated/typetest-property-nullable/README.md index 53deb974893..463888fe727 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/README.md @@ -1,5 +1,3 @@ - - # Typetest Property Nullable client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-property-nullable - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Property Nullable instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py index 87876e0d12e..9e2ec035c45 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-nullable" +PACKAGE_NAMESPACE = "typetest.property.nullable" PACKAGE_PPRINT_NAME = "Typetest Property Nullable" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-property-optional/MANIFEST.in index 7de1ad09fbc..2b81dc34d38 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/optional/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/README.md b/packages/typespec-python/test/azure/generated/typetest-property-optional/README.md index 9467e0ad02d..91934a365a1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/README.md @@ -1,5 +1,3 @@ - - # Typetest Property Optional client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-property-optional - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Property Optional instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py index 7d2a3cd91fe..258b383b19d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-optional" +PACKAGE_NAMESPACE = "typetest.property.optional" PACKAGE_PPRINT_NAME = "Typetest Property Optional" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/MANIFEST.in index de3b3dbb96f..1168e7f57aa 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/valuetypes/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/README.md b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/README.md index 57072e646d1..94d17ab8485 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/README.md @@ -1,5 +1,3 @@ - - # Typetest Property Valuetypes client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-property-valuetypes - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Property Valuetypes instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py index 2cc02c80797..f148d38235d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-valuetypes" +PACKAGE_NAMESPACE = "typetest.property.valuetypes" PACKAGE_PPRINT_NAME = "Typetest Property Valuetypes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-scalar/MANIFEST.in index a58aab400ed..61880ef6cba 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/scalar/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/README.md b/packages/typespec-python/test/azure/generated/typetest-scalar/README.md index 29451029d45..616cadbb029 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/README.md @@ -1,5 +1,3 @@ - - # Typetest Scalar client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-scalar - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Scalar instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py b/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py index cd06b8845b0..e4ff994e2fe 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-scalar" +PACKAGE_NAMESPACE = "typetest.scalar" PACKAGE_PPRINT_NAME = "Typetest Scalar" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/MANIFEST.in b/packages/typespec-python/test/azure/generated/typetest-union/MANIFEST.in index e66a3e513b1..607206a947f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/typetest-union/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/union/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/azure/generated/typetest-union/README.md b/packages/typespec-python/test/azure/generated/typetest-union/README.md index 7438d06b0f6..9bd5719c2dd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/README.md +++ b/packages/typespec-python/test/azure/generated/typetest-union/README.md @@ -1,5 +1,3 @@ - - # Typetest Union client library for Python @@ -17,6 +15,7 @@ python -m pip install typetest-union - You need an [Azure subscription][azure_sub] to use this package. - An existing Typetest Union instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/typetest-union/setup.py b/packages/typespec-python/test/azure/generated/typetest-union/setup.py index 587ffd51001..45d71d7cdb2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-union" +PACKAGE_NAMESPACE = "typetest.union" PACKAGE_PPRINT_NAME = "Typetest Union" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py index 974dc9d1b10..4ff35e49dc4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -82,11 +82,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -100,7 +100,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -130,7 +130,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -267,11 +267,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -285,7 +285,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -315,7 +315,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -454,11 +454,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -472,7 +472,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -502,7 +502,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -645,11 +645,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -663,7 +663,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -693,7 +693,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -826,11 +826,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -844,7 +844,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -874,7 +874,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1005,11 +1005,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1023,7 +1023,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1053,7 +1053,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1188,11 +1188,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1206,7 +1206,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1236,7 +1236,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1371,11 +1371,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1389,7 +1389,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1419,7 +1419,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1554,11 +1554,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1572,7 +1572,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1602,7 +1602,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1737,11 +1737,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1755,7 +1755,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1785,7 +1785,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py index 64bf34989d6..a635d6561b2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py @@ -112,18 +112,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload @@ -140,18 +140,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -168,18 +170,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -196,18 +200,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -224,18 +228,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -252,18 +256,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -280,18 +284,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -308,20 +312,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -338,20 +340,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -368,18 +368,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py index 34efe0563d6..c9d80b640f5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py @@ -343,11 +343,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -361,7 +361,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -391,7 +391,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -526,11 +526,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -544,7 +544,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -574,7 +574,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -713,11 +713,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -731,7 +731,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -761,7 +761,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -904,11 +904,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -922,7 +922,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -952,7 +952,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1085,11 +1085,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1103,7 +1103,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1133,7 +1133,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1266,11 +1266,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1284,7 +1284,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1314,7 +1314,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1449,11 +1449,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1467,7 +1467,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1497,7 +1497,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1630,11 +1630,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1648,7 +1648,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1678,7 +1678,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1811,11 +1811,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1829,7 +1829,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1859,7 +1859,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1992,11 +1992,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2010,7 +2010,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -2040,7 +2040,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/versioning-added/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-added/MANIFEST.in index b1be260c62a..53ff76c3a87 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-added/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/added/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-added/README.md b/packages/typespec-python/test/azure/generated/versioning-added/README.md index a6227b40b52..0906f8d2388 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-added/README.md @@ -1,5 +1,3 @@ - - # Versioning Added client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-added - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Added instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-added/setup.py b/packages/typespec-python/test/azure/generated/versioning-added/setup.py index e04de29ea1a..53a52331d16 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-added" +PACKAGE_NAMESPACE = "versioning.added" PACKAGE_PPRINT_NAME = "Versioning Added" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-madeoptional/MANIFEST.in index 0fe89d7fd9e..0c3e336fcef 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/madeoptional/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/README.md b/packages/typespec-python/test/azure/generated/versioning-madeoptional/README.md index bd69c9deeb2..3cd90f5b32c 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/README.md @@ -1,5 +1,3 @@ - - # Versioning Madeoptional client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-madeoptional - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Madeoptional instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py index d7818e4f748..f40c550e34c 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-madeoptional" +PACKAGE_NAMESPACE = "versioning.madeoptional" PACKAGE_PPRINT_NAME = "Versioning Madeoptional" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-removed/MANIFEST.in index fac2b952d50..85d3fb2ce8c 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-removed/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/removed/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/README.md b/packages/typespec-python/test/azure/generated/versioning-removed/README.md index eb42466c2db..b62ebddfcb5 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-removed/README.md @@ -1,5 +1,3 @@ - - # Versioning Removed client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-removed - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Removed instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/setup.py b/packages/typespec-python/test/azure/generated/versioning-removed/setup.py index c951374f0f9..95d2ab4300d 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-removed" +PACKAGE_NAMESPACE = "versioning.removed" PACKAGE_PPRINT_NAME = "Versioning Removed" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/MANIFEST.in index e8853b0efa9..68c9d666a33 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/renamedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/README.md b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/README.md index 49af6693435..10ca4e24054 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/README.md @@ -1,5 +1,3 @@ - - # Versioning Renamedfrom client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-renamedfrom - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Renamedfrom instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py index 7c5262de6b7..220e00a1259 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-renamedfrom" +PACKAGE_NAMESPACE = "versioning.renamedfrom" PACKAGE_PPRINT_NAME = "Versioning Renamedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/MANIFEST.in index 9908ce3b143..d097edf0a73 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/returntypechangedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/README.md b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/README.md index 131cecd842b..e85ac34ca4c 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/README.md @@ -1,5 +1,3 @@ - - # Versioning Returntypechangedfrom client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-returntypechangedfrom - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Returntypechangedfrom instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py index 883eab7a6bd..21c1f641eb1 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-returntypechangedfrom" +PACKAGE_NAMESPACE = "versioning.returntypechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Returntypechangedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/MANIFEST.in b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/MANIFEST.in index 9d66ecf8fe3..667a92076b0 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/typechangedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/README.md b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/README.md index dbb623ac417..5cd5efa18fb 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/README.md +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/README.md @@ -1,5 +1,3 @@ - - # Versioning Typechangedfrom client library for Python @@ -17,6 +15,7 @@ python -m pip install versioning-typechangedfrom - You need an [Azure subscription][azure_sub] to use this package. - An existing Versioning Typechangedfrom instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py index 623498c7a3f..21efd7772ec 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-typechangedfrom" +PACKAGE_NAMESPACE = "versioning.typechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Typechangedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/authentication-api-key/MANIFEST.in index 84258db3b15..805328d742a 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/apikey/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py index 08de819a560..f185d8fc3c1 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-apikey" +PACKAGE_NAMESPACE = "authentication.apikey" PACKAGE_PPRINT_NAME = "Authentication Apikey" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/MANIFEST.in index b61198cfa7f..6f9c2254b26 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/MANIFEST.in @@ -4,4 +4,4 @@ include authentication/http/custom/py.typed recursive-include tests *.py recursive-include samples *.py *.md include authentication/__init__.py -include authentication/http/__init__.py \ No newline at end of file +include authentication/http/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py index e98cb77b42b..662fffa0cfa 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-http-custom" -PACKAGE_PPRINT_NAME = "Authentication Http Custom Service" +PACKAGE_NAMESPACE = "authentication.http.custom" +PACKAGE_PPRINT_NAME = "Authentication Http Custom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/MANIFEST.in index 9c73f66d6b1..9bb1ed4315f 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/oauth2/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py index 50db5ae8fc0..851ca9fc916 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-oauth2" +PACKAGE_NAMESPACE = "authentication.oauth2" PACKAGE_PPRINT_NAME = "Authentication Oauth2" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/authentication-union/MANIFEST.in index 83649fb608a..a8e19db2766 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include authentication/union/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include authentication/__init__.py \ No newline at end of file +include authentication/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py index 216a20fbcb9..616f56688c5 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "authentication-union" +PACKAGE_NAMESPACE = "authentication.union" PACKAGE_PPRINT_NAME = "Authentication Union" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/encode-bytes/MANIFEST.in index 75b3ca6eac0..8b0e3efbc6c 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/bytes/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py index 02415c9d3c2..3a9a0c801b5 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models3 +from .... import models as _models from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import BytesClientConfiguration @@ -64,8 +64,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models3.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultBytesProperty: + self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -81,7 +81,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultBytesProperty: + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -97,7 +97,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultBytesProperty: + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -111,8 +111,8 @@ async def default( """ async def default( - self, body: Union[_models3.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.DefaultBytesProperty: + self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -133,7 +133,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -170,7 +170,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -179,8 +179,8 @@ async def default( @overload async def base64( - self, body: _models3.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64BytesProperty: + self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -196,7 +196,7 @@ async def base64( @overload async def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64BytesProperty: + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -212,7 +212,7 @@ async def base64( @overload async def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64BytesProperty: + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -226,8 +226,8 @@ async def base64( """ async def base64( - self, body: Union[_models3.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.Base64BytesProperty: + self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -248,7 +248,7 @@ async def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -285,7 +285,7 @@ async def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -294,8 +294,8 @@ async def base64( @overload async def base64_url( - self, body: _models3.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlBytesProperty: + self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -311,7 +311,7 @@ async def base64_url( @overload async def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlBytesProperty: + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -327,7 +327,7 @@ async def base64_url( @overload async def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlBytesProperty: + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -341,8 +341,8 @@ async def base64_url( """ async def base64_url( - self, body: Union[_models3.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.Base64urlBytesProperty: + self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -363,7 +363,7 @@ async def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -400,7 +400,7 @@ async def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -409,8 +409,8 @@ async def base64_url( @overload async def base64_url_array( - self, body: _models3.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlArrayBytesProperty: + self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -427,7 +427,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlArrayBytesProperty: + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -444,7 +444,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Base64urlArrayBytesProperty: + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -459,8 +459,8 @@ async def base64_url_array( """ async def base64_url_array( - self, body: Union[_models3.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.Base64urlArrayBytesProperty: + self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -483,7 +483,7 @@ async def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -520,7 +520,7 @@ async def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py index eb4982e1f8f..d66408f7201 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._configuration import BytesClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -129,8 +129,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models2.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultBytesProperty: + self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -146,7 +146,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultBytesProperty: + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -162,7 +162,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultBytesProperty: + ) -> _models.DefaultBytesProperty: """default. :param body: Required. @@ -176,8 +176,8 @@ def default( """ def default( - self, body: Union[_models2.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.DefaultBytesProperty: + self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -198,7 +198,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -235,7 +235,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -244,8 +244,8 @@ def default( @overload def base64( - self, body: _models2.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64BytesProperty: + self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -261,7 +261,7 @@ def base64( @overload def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64BytesProperty: + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -277,7 +277,7 @@ def base64( @overload def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64BytesProperty: + ) -> _models.Base64BytesProperty: """base64. :param body: Required. @@ -291,8 +291,8 @@ def base64( """ def base64( - self, body: Union[_models2.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Base64BytesProperty: + self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -313,7 +313,7 @@ def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -350,7 +350,7 @@ def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -359,8 +359,8 @@ def base64( @overload def base64_url( - self, body: _models2.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlBytesProperty: + self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -376,7 +376,7 @@ def base64_url( @overload def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlBytesProperty: + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -392,7 +392,7 @@ def base64_url( @overload def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlBytesProperty: + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -406,8 +406,8 @@ def base64_url( """ def base64_url( - self, body: Union[_models2.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Base64urlBytesProperty: + self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -428,7 +428,7 @@ def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -465,7 +465,7 @@ def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -474,8 +474,8 @@ def base64_url( @overload def base64_url_array( - self, body: _models2.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlArrayBytesProperty: + self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -492,7 +492,7 @@ def base64_url_array( @overload def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlArrayBytesProperty: + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -509,7 +509,7 @@ def base64_url_array( @overload def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Base64urlArrayBytesProperty: + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -524,8 +524,8 @@ def base64_url_array( """ def base64_url_array( - self, body: Union[_models2.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Base64urlArrayBytesProperty: + self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -548,7 +548,7 @@ def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -585,7 +585,7 @@ def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py index 59e408d18ba..40f96a1803c 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-bytes" +PACKAGE_NAMESPACE = "encode.bytes" PACKAGE_PPRINT_NAME = "Encode Bytes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/encode-datetime/MANIFEST.in index 63254f8a20e..d686e124bfd 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/datetime/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py index 5cb74599ca8..225e1a14bf4 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models3 +from .... import models as _models from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import DatetimeClientConfiguration @@ -65,8 +65,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models3.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultDatetimeProperty: + self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -82,7 +82,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultDatetimeProperty: + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -98,7 +98,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.DefaultDatetimeProperty: + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -112,8 +112,8 @@ async def default( """ async def default( - self, body: Union[_models3.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.DefaultDatetimeProperty: + self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -134,7 +134,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -171,7 +171,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -180,8 +180,8 @@ async def default( @overload async def rfc3339( - self, body: _models3.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc3339DatetimeProperty: + self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -197,7 +197,7 @@ async def rfc3339( @overload async def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc3339DatetimeProperty: + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -213,7 +213,7 @@ async def rfc3339( @overload async def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc3339DatetimeProperty: + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -227,8 +227,8 @@ async def rfc3339( """ async def rfc3339( - self, body: Union[_models3.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.Rfc3339DatetimeProperty: + self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -249,7 +249,7 @@ async def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -286,7 +286,7 @@ async def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -295,8 +295,8 @@ async def rfc3339( @overload async def rfc7231( - self, body: _models3.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc7231DatetimeProperty: + self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -312,7 +312,7 @@ async def rfc7231( @overload async def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc7231DatetimeProperty: + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -328,7 +328,7 @@ async def rfc7231( @overload async def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.Rfc7231DatetimeProperty: + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -342,8 +342,8 @@ async def rfc7231( """ async def rfc7231( - self, body: Union[_models3.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.Rfc7231DatetimeProperty: + self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -364,7 +364,7 @@ async def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -401,7 +401,7 @@ async def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -410,8 +410,8 @@ async def rfc7231( @overload async def unix_timestamp( - self, body: _models3.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.UnixTimestampDatetimeProperty: + self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -428,7 +428,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.UnixTimestampDatetimeProperty: + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -445,7 +445,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.UnixTimestampDatetimeProperty: + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -460,8 +460,8 @@ async def unix_timestamp( """ async def unix_timestamp( - self, body: Union[_models3.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.UnixTimestampDatetimeProperty: + self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -484,7 +484,7 @@ async def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -521,7 +521,7 @@ async def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -530,12 +530,8 @@ async def unix_timestamp( @overload async def unix_timestamp_array( - self, - body: _models3.UnixTimestampArrayDatetimeProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.UnixTimestampArrayDatetimeProperty: + self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -552,7 +548,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.UnixTimestampArrayDatetimeProperty: + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -569,7 +565,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.UnixTimestampArrayDatetimeProperty: + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -584,8 +580,8 @@ async def unix_timestamp_array( """ async def unix_timestamp_array( - self, body: Union[_models3.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -608,7 +604,7 @@ async def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -645,7 +641,7 @@ async def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models3.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py index 2c4f2b09a24..631626311cd 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._configuration import DatetimeClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -146,8 +146,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models2.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDatetimeProperty: + self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -163,7 +163,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDatetimeProperty: + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -179,7 +179,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDatetimeProperty: + ) -> _models.DefaultDatetimeProperty: """default. :param body: Required. @@ -193,8 +193,8 @@ def default( """ def default( - self, body: Union[_models2.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.DefaultDatetimeProperty: + self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -215,7 +215,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -252,7 +252,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -261,8 +261,8 @@ def default( @overload def rfc3339( - self, body: _models2.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc3339DatetimeProperty: + self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -278,7 +278,7 @@ def rfc3339( @overload def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc3339DatetimeProperty: + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -294,7 +294,7 @@ def rfc3339( @overload def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc3339DatetimeProperty: + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -308,8 +308,8 @@ def rfc3339( """ def rfc3339( - self, body: Union[_models2.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Rfc3339DatetimeProperty: + self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -330,7 +330,7 @@ def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -367,7 +367,7 @@ def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -376,8 +376,8 @@ def rfc3339( @overload def rfc7231( - self, body: _models2.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc7231DatetimeProperty: + self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -393,7 +393,7 @@ def rfc7231( @overload def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc7231DatetimeProperty: + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -409,7 +409,7 @@ def rfc7231( @overload def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Rfc7231DatetimeProperty: + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -423,8 +423,8 @@ def rfc7231( """ def rfc7231( - self, body: Union[_models2.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Rfc7231DatetimeProperty: + self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -445,7 +445,7 @@ def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -482,7 +482,7 @@ def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -491,8 +491,8 @@ def rfc7231( @overload def unix_timestamp( - self, body: _models2.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.UnixTimestampDatetimeProperty: + self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -509,7 +509,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.UnixTimestampDatetimeProperty: + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -526,7 +526,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.UnixTimestampDatetimeProperty: + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -541,8 +541,8 @@ def unix_timestamp( """ def unix_timestamp( - self, body: Union[_models2.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.UnixTimestampDatetimeProperty: + self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -565,7 +565,7 @@ def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -602,7 +602,7 @@ def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -611,12 +611,8 @@ def unix_timestamp( @overload def unix_timestamp_array( - self, - body: _models2.UnixTimestampArrayDatetimeProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models2.UnixTimestampArrayDatetimeProperty: + self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -633,7 +629,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.UnixTimestampArrayDatetimeProperty: + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -650,7 +646,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.UnixTimestampArrayDatetimeProperty: + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -665,8 +661,8 @@ def unix_timestamp_array( """ def unix_timestamp_array( - self, body: Union[_models2.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -689,7 +685,7 @@ def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -726,7 +722,7 @@ def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py index 4ae6cfd8dd1..ba5d3525412 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-datetime" +PACKAGE_NAMESPACE = "encode.datetime" PACKAGE_PPRINT_NAME = "Encode Datetime" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/encode-duration/MANIFEST.in index 62dea304f68..3979592823a 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/duration/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py index 7aad977e72f..81d70db8b17 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import DurationClientConfiguration @@ -66,8 +66,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models2.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDurationProperty: + self, body: _models.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -83,7 +83,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDurationProperty: + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -99,7 +99,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DefaultDurationProperty: + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -113,8 +113,8 @@ async def default( """ async def default( - self, body: Union[_models2.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.DefaultDurationProperty: + self, body: Union[_models.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultDurationProperty: """default. :param body: Is one of the following types: DefaultDurationProperty, JSON, IO[bytes] Required. @@ -135,7 +135,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.DefaultDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -172,7 +172,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DefaultDurationProperty, response.json()) + deserialized = _deserialize(_models.DefaultDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -181,8 +181,8 @@ async def default( @overload async def iso8601( - self, body: _models2.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ISO8601DurationProperty: + self, body: _models.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -198,7 +198,7 @@ async def iso8601( @overload async def iso8601( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ISO8601DurationProperty: + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -214,7 +214,7 @@ async def iso8601( @overload async def iso8601( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ISO8601DurationProperty: + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -228,8 +228,8 @@ async def iso8601( """ async def iso8601( - self, body: Union[_models2.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.ISO8601DurationProperty: + self, body: Union[_models.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Is one of the following types: ISO8601DurationProperty, JSON, IO[bytes] Required. @@ -250,7 +250,7 @@ async def iso8601( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ISO8601DurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.ISO8601DurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -287,7 +287,7 @@ async def iso8601( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ISO8601DurationProperty, response.json()) + deserialized = _deserialize(_models.ISO8601DurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -296,8 +296,8 @@ async def iso8601( @overload async def int32_seconds( - self, body: _models2.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Int32SecondsDurationProperty: + self, body: _models.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -314,7 +314,7 @@ async def int32_seconds( @overload async def int32_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Int32SecondsDurationProperty: + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -331,7 +331,7 @@ async def int32_seconds( @overload async def int32_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Int32SecondsDurationProperty: + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -346,8 +346,8 @@ async def int32_seconds( """ async def int32_seconds( - self, body: Union[_models2.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Int32SecondsDurationProperty: + self, body: Union[_models.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Is one of the following types: Int32SecondsDurationProperty, JSON, IO[bytes] @@ -370,7 +370,7 @@ async def int32_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Int32SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Int32SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -407,7 +407,7 @@ async def int32_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Int32SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.Int32SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -416,8 +416,8 @@ async def int32_seconds( @overload async def float_seconds( - self, body: _models2.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationProperty: + self, body: _models.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -434,7 +434,7 @@ async def float_seconds( @overload async def float_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationProperty: + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -451,7 +451,7 @@ async def float_seconds( @overload async def float_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationProperty: + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -466,8 +466,8 @@ async def float_seconds( """ async def float_seconds( - self, body: Union[_models2.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.FloatSecondsDurationProperty: + self, body: Union[_models.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Is one of the following types: FloatSecondsDurationProperty, JSON, IO[bytes] @@ -490,7 +490,7 @@ async def float_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.FloatSecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.FloatSecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -527,7 +527,7 @@ async def float_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.FloatSecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.FloatSecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -536,8 +536,8 @@ async def float_seconds( @overload async def float64_seconds( - self, body: _models2.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Float64SecondsDurationProperty: + self, body: _models.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -554,7 +554,7 @@ async def float64_seconds( @overload async def float64_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Float64SecondsDurationProperty: + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -571,7 +571,7 @@ async def float64_seconds( @overload async def float64_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Float64SecondsDurationProperty: + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -586,8 +586,8 @@ async def float64_seconds( """ async def float64_seconds( - self, body: Union[_models2.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Float64SecondsDurationProperty: + self, body: Union[_models.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Is one of the following types: Float64SecondsDurationProperty, JSON, IO[bytes] @@ -610,7 +610,7 @@ async def float64_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Float64SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Float64SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -647,7 +647,7 @@ async def float64_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Float64SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.Float64SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -656,8 +656,8 @@ async def float64_seconds( @overload async def float_seconds_array( - self, body: _models2.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationArrayProperty: + self, body: _models.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -674,7 +674,7 @@ async def float_seconds_array( @overload async def float_seconds_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationArrayProperty: + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -691,7 +691,7 @@ async def float_seconds_array( @overload async def float_seconds_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.FloatSecondsDurationArrayProperty: + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -706,8 +706,8 @@ async def float_seconds_array( """ async def float_seconds_array( - self, body: Union[_models2.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.FloatSecondsDurationArrayProperty: + self, body: Union[_models.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Is one of the following types: FloatSecondsDurationArrayProperty, JSON, IO[bytes] @@ -730,7 +730,7 @@ async def float_seconds_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -767,7 +767,7 @@ async def float_seconds_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.FloatSecondsDurationArrayProperty, response.json()) + deserialized = _deserialize(_models.FloatSecondsDurationArrayProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py index 34a3aec9b4c..4f00044c61b 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import DurationClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -163,8 +163,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models1.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DefaultDurationProperty: + self, body: _models.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -180,7 +180,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DefaultDurationProperty: + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -196,7 +196,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DefaultDurationProperty: + ) -> _models.DefaultDurationProperty: """default. :param body: Required. @@ -210,8 +210,8 @@ def default( """ def default( - self, body: Union[_models1.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.DefaultDurationProperty: + self, body: Union[_models.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DefaultDurationProperty: """default. :param body: Is one of the following types: DefaultDurationProperty, JSON, IO[bytes] Required. @@ -232,7 +232,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.DefaultDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.DefaultDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -269,7 +269,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.DefaultDurationProperty, response.json()) + deserialized = _deserialize(_models.DefaultDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -278,8 +278,8 @@ def default( @overload def iso8601( - self, body: _models1.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ISO8601DurationProperty: + self, body: _models.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -295,7 +295,7 @@ def iso8601( @overload def iso8601( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ISO8601DurationProperty: + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -311,7 +311,7 @@ def iso8601( @overload def iso8601( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ISO8601DurationProperty: + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -325,8 +325,8 @@ def iso8601( """ def iso8601( - self, body: Union[_models1.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.ISO8601DurationProperty: + self, body: Union[_models.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.ISO8601DurationProperty: """iso8601. :param body: Is one of the following types: ISO8601DurationProperty, JSON, IO[bytes] Required. @@ -347,7 +347,7 @@ def iso8601( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ISO8601DurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.ISO8601DurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -384,7 +384,7 @@ def iso8601( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ISO8601DurationProperty, response.json()) + deserialized = _deserialize(_models.ISO8601DurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -393,8 +393,8 @@ def iso8601( @overload def int32_seconds( - self, body: _models1.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Int32SecondsDurationProperty: + self, body: _models.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -411,7 +411,7 @@ def int32_seconds( @overload def int32_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Int32SecondsDurationProperty: + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -428,7 +428,7 @@ def int32_seconds( @overload def int32_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Int32SecondsDurationProperty: + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -443,8 +443,8 @@ def int32_seconds( """ def int32_seconds( - self, body: Union[_models1.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.Int32SecondsDurationProperty: + self, body: Union[_models.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Int32SecondsDurationProperty: """int32_seconds. :param body: Is one of the following types: Int32SecondsDurationProperty, JSON, IO[bytes] @@ -467,7 +467,7 @@ def int32_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Int32SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Int32SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -504,7 +504,7 @@ def int32_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Int32SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.Int32SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -513,8 +513,8 @@ def int32_seconds( @overload def float_seconds( - self, body: _models1.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationProperty: + self, body: _models.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -531,7 +531,7 @@ def float_seconds( @overload def float_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationProperty: + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -548,7 +548,7 @@ def float_seconds( @overload def float_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationProperty: + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -563,8 +563,8 @@ def float_seconds( """ def float_seconds( - self, body: Union[_models1.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.FloatSecondsDurationProperty: + self, body: Union[_models.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.FloatSecondsDurationProperty: """float_seconds. :param body: Is one of the following types: FloatSecondsDurationProperty, JSON, IO[bytes] @@ -587,7 +587,7 @@ def float_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.FloatSecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.FloatSecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -624,7 +624,7 @@ def float_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.FloatSecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.FloatSecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -633,8 +633,8 @@ def float_seconds( @overload def float64_seconds( - self, body: _models1.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Float64SecondsDurationProperty: + self, body: _models.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -651,7 +651,7 @@ def float64_seconds( @overload def float64_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Float64SecondsDurationProperty: + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -668,7 +668,7 @@ def float64_seconds( @overload def float64_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Float64SecondsDurationProperty: + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -683,8 +683,8 @@ def float64_seconds( """ def float64_seconds( - self, body: Union[_models1.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.Float64SecondsDurationProperty: + self, body: Union[_models.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Float64SecondsDurationProperty: """float64_seconds. :param body: Is one of the following types: Float64SecondsDurationProperty, JSON, IO[bytes] @@ -707,7 +707,7 @@ def float64_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Float64SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Float64SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -744,7 +744,7 @@ def float64_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Float64SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models.Float64SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -753,8 +753,8 @@ def float64_seconds( @overload def float_seconds_array( - self, body: _models1.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationArrayProperty: + self, body: _models.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -771,7 +771,7 @@ def float_seconds_array( @overload def float_seconds_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationArrayProperty: + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -788,7 +788,7 @@ def float_seconds_array( @overload def float_seconds_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.FloatSecondsDurationArrayProperty: + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -803,8 +803,8 @@ def float_seconds_array( """ def float_seconds_array( - self, body: Union[_models1.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.FloatSecondsDurationArrayProperty: + self, body: Union[_models.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Is one of the following types: FloatSecondsDurationArrayProperty, JSON, IO[bytes] @@ -827,7 +827,7 @@ def float_seconds_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -864,7 +864,7 @@ def float_seconds_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.FloatSecondsDurationArrayProperty, response.json()) + deserialized = _deserialize(_models.FloatSecondsDurationArrayProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py b/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py index b03b5a1df62..22972be2783 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-duration" +PACKAGE_NAMESPACE = "encode.duration" PACKAGE_PPRINT_NAME = "Encode Duration" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/encode-numeric/MANIFEST.in index c5a0766925a..9f4baead01e 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include encode/numeric/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include encode/__init__.py \ No newline at end of file +include encode/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py index 3b4cc092892..1a4f1d944ec 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import NumericClientConfiguration @@ -63,8 +63,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def safeint_as_string( - self, value: _models2.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SafeintAsStringProperty: + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -80,7 +80,7 @@ async def safeint_as_string( @overload async def safeint_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SafeintAsStringProperty: + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -96,7 +96,7 @@ async def safeint_as_string( @overload async def safeint_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SafeintAsStringProperty: + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -110,8 +110,8 @@ async def safeint_as_string( """ async def safeint_as_string( - self, value: Union[_models2.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.SafeintAsStringProperty: + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. @@ -132,7 +132,7 @@ async def safeint_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.SafeintAsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.SafeintAsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -169,7 +169,7 @@ async def safeint_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.SafeintAsStringProperty, response.json()) + deserialized = _deserialize(_models.SafeintAsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -178,8 +178,8 @@ async def safeint_as_string( @overload async def uint32_as_string_optional( - self, value: _models2.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint32AsStringProperty: + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -195,7 +195,7 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint32AsStringProperty: + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -211,7 +211,7 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint32AsStringProperty: + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -225,8 +225,8 @@ async def uint32_as_string_optional( """ async def uint32_as_string_optional( - self, value: Union[_models2.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Uint32AsStringProperty: + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. @@ -247,7 +247,7 @@ async def uint32_as_string_optional( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Uint32AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Uint32AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -284,7 +284,7 @@ async def uint32_as_string_optional( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Uint32AsStringProperty, response.json()) + deserialized = _deserialize(_models.Uint32AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -293,8 +293,8 @@ async def uint32_as_string_optional( @overload async def uint8_as_string( - self, value: _models2.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint8AsStringProperty: + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -310,7 +310,7 @@ async def uint8_as_string( @overload async def uint8_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint8AsStringProperty: + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -326,7 +326,7 @@ async def uint8_as_string( @overload async def uint8_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Uint8AsStringProperty: + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -340,8 +340,8 @@ async def uint8_as_string( """ async def uint8_as_string( - self, value: Union[_models2.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Uint8AsStringProperty: + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. @@ -362,7 +362,7 @@ async def uint8_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Uint8AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -399,7 +399,7 @@ async def uint8_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Uint8AsStringProperty, response.json()) + deserialized = _deserialize(_models.Uint8AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py index 41da6fc1959..ddd38bc07c9 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import NumericClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -112,8 +112,8 @@ def __init__(self, *args, **kwargs): @overload def safeint_as_string( - self, value: _models1.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.SafeintAsStringProperty: + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -129,7 +129,7 @@ def safeint_as_string( @overload def safeint_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.SafeintAsStringProperty: + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -145,7 +145,7 @@ def safeint_as_string( @overload def safeint_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.SafeintAsStringProperty: + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -159,8 +159,8 @@ def safeint_as_string( """ def safeint_as_string( - self, value: Union[_models1.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.SafeintAsStringProperty: + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.SafeintAsStringProperty: """safeint_as_string. :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. @@ -181,7 +181,7 @@ def safeint_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.SafeintAsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.SafeintAsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -218,7 +218,7 @@ def safeint_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.SafeintAsStringProperty, response.json()) + deserialized = _deserialize(_models.SafeintAsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -227,8 +227,8 @@ def safeint_as_string( @overload def uint32_as_string_optional( - self, value: _models1.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint32AsStringProperty: + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -244,7 +244,7 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint32AsStringProperty: + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -260,7 +260,7 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint32AsStringProperty: + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -274,8 +274,8 @@ def uint32_as_string_optional( """ def uint32_as_string_optional( - self, value: Union[_models1.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.Uint32AsStringProperty: + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. @@ -296,7 +296,7 @@ def uint32_as_string_optional( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Uint32AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Uint32AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -333,7 +333,7 @@ def uint32_as_string_optional( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Uint32AsStringProperty, response.json()) + deserialized = _deserialize(_models.Uint32AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -342,8 +342,8 @@ def uint32_as_string_optional( @overload def uint8_as_string( - self, value: _models1.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint8AsStringProperty: + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -359,7 +359,7 @@ def uint8_as_string( @overload def uint8_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint8AsStringProperty: + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -375,7 +375,7 @@ def uint8_as_string( @overload def uint8_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Uint8AsStringProperty: + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -389,8 +389,8 @@ def uint8_as_string( """ def uint8_as_string( - self, value: Union[_models1.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.Uint8AsStringProperty: + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: """uint8_as_string. :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. @@ -411,7 +411,7 @@ def uint8_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Uint8AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -448,7 +448,7 @@ def uint8_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Uint8AsStringProperty, response.json()) + deserialized = _deserialize(_models.Uint8AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py index 94c985edce5..9582c6982b3 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "encode-numeric" +PACKAGE_NAMESPACE = "encode.numeric" PACKAGE_PPRINT_NAME = "Encode Numeric" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/MANIFEST.in index 3a185557967..8d48e547d69 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include headasbooleanfalse/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py index f6feef26f67..8cf3473397c 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "headasbooleanfalse" +PACKAGE_NAMESPACE = "headasbooleanfalse" PACKAGE_PPRINT_NAME = "Headasbooleanfalse" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/MANIFEST.in index 89f2c0dccd2..d79293c6f31 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include headasbooleantrue/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py index bcfc0765e97..b692194610e 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "headasbooleantrue" +PACKAGE_NAMESPACE = "headasbooleantrue" PACKAGE_PPRINT_NAME = "Headasbooleantrue" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/parameters-basic/MANIFEST.in index 18f9767aa78..ec6eea5b987 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/basic/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py index b3152f25c50..5a458654a48 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import BasicClientConfiguration @@ -56,7 +56,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def simple(self, body: _models2.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: """simple. :param body: Required. @@ -97,7 +97,7 @@ async def simple(self, body: IO[bytes], *, content_type: str = "application/json :raises ~corehttp.exceptions.HttpResponseError: """ - async def simple(self, body: Union[_models2.User, JSON, IO[bytes]], **kwargs: Any) -> None: + async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: """simple. :param body: Is one of the following types: User, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py index 88c50808e89..e618712b5ed 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import BasicClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def simple(self, body: _models1.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: """simple. :param body: Required. @@ -114,7 +114,7 @@ def simple(self, body: IO[bytes], *, content_type: str = "application/json", **k """ def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.User, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any ) -> None: """simple. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py index cda12726e40..d9dac9b4a50 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-basic" +PACKAGE_NAMESPACE = "parameters.basic" PACKAGE_PPRINT_NAME = "Parameters Basic" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/MANIFEST.in index 0d45a014ef2..2dad293a4dc 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/bodyoptionality/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py index f70f6f14c8d..ec22581ae63 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from .._model_base import SdkJSONEncoder from .._serialization import Serializer from .._vendor import BodyOptionalityClientMixinABC @@ -72,7 +72,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload def required_explicit( - self, body: _models1.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -115,7 +115,7 @@ def required_explicit(self, body: IO[bytes], *, content_type: str = "application """ def required_explicit( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.BodyModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """required_explicit. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py index 3596af95acb..7dffa9c6de0 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._model_base import SdkJSONEncoder from ..._operations._operations import ( build_body_optionality_required_explicit_request, @@ -44,7 +44,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload async def required_explicit( - self, body: _models2.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -88,7 +88,7 @@ async def required_explicit( :raises ~corehttp.exceptions.HttpResponseError: """ - async def required_explicit(self, body: Union[_models2.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: """required_explicit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py index b967dd3daf3..9de2980870a 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models3 +from .... import models as _models from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import BodyOptionalityClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def set( - self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -101,7 +101,7 @@ async def set( :raises ~corehttp.exceptions.HttpResponseError: """ - async def set(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """set. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. @@ -159,7 +159,7 @@ async def set(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = @overload async def omit( - self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -203,7 +203,7 @@ async def omit( :raises ~corehttp.exceptions.HttpResponseError: """ - async def omit(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """omit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py index 359aad662de..7d99ca79c8e 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._configuration import BodyOptionalityClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -87,7 +87,7 @@ def __init__(self, *args, **kwargs): @overload def set( - self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -130,7 +130,7 @@ def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applicat """ def set( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """set. @@ -189,7 +189,7 @@ def set( # pylint: disable=inconsistent-return-statements @overload def omit( - self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -232,7 +232,7 @@ def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applica """ def omit( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """omit. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py index eaca7582ed4..98bcf0e4f65 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-bodyoptionality" +PACKAGE_NAMESPACE = "parameters.bodyoptionality" PACKAGE_PPRINT_NAME = "Parameters Bodyoptionality" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/MANIFEST.in index 90d0ba2db1f..e4e65c4a1d5 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/collectionformat/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py index 22e80f2c13a..76bafb182b1 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py @@ -54,7 +54,7 @@ def build_query_ssv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: _url = "/parameters/collection-format/query/ssv" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=" ") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) @@ -66,7 +66,7 @@ def build_query_tsv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: _url = "/parameters/collection-format/query/tsv" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=" ") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) @@ -78,7 +78,7 @@ def build_query_pipes_request(*, colors: List[str], **kwargs: Any) -> HttpReques _url = "/parameters/collection-format/query/pipes" # Construct parameters - _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div="|") + _params["colors"] = _SERIALIZER.query("colors", colors, "[str]", div=",") return HttpRequest(method="GET", url=_url, params=_params, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py index 5d567f8431e..a4877fcbc57 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-collectionformat" +PACKAGE_NAMESPACE = "parameters.collectionformat" PACKAGE_PPRINT_NAME = "Parameters Collectionformat" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/parameters-spread/MANIFEST.in index 1deab2a88dd..eae446dee33 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include parameters/spread/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include parameters/__init__.py \ No newline at end of file +include parameters/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py index 02f72182c7d..a1c6e8aa48f 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpreadClientConfiguration @@ -172,7 +172,7 @@ async def spread_as_request_body( @overload async def spread_composite_request_only_with_body( - self, body: _models2.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -219,7 +219,7 @@ async def spread_composite_request_only_with_body( """ async def spread_composite_request_only_with_body( - self, body: Union[_models2.BodyParameter, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -324,7 +324,7 @@ async def spread_composite_request_without_body(self, name: str, *, test_header: async def spread_composite_request( self, name: str, - body: _models2.BodyParameter, + body: _models.BodyParameter, *, test_header: str, content_type: str = "application/json", @@ -387,7 +387,7 @@ async def spread_composite_request( """ async def spread_composite_request( - self, name: str, body: Union[_models2.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any ) -> None: """spread_composite_request. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py index 6d1daa2f100..4fdbaf9b805 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import SpreadClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -257,7 +257,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements @overload def spread_composite_request_only_with_body( - self, body: _models1.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -304,7 +304,7 @@ def spread_composite_request_only_with_body( """ def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.BodyParameter, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -411,7 +411,7 @@ def spread_composite_request_without_body( # pylint: disable=inconsistent-retur def spread_composite_request( self, name: str, - body: _models1.BodyParameter, + body: _models.BodyParameter, *, test_header: str, content_type: str = "application/json", @@ -474,7 +474,7 @@ def spread_composite_request( """ def spread_composite_request( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[_models1.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any ) -> None: """spread_composite_request. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py index 90dbe71acf0..332ea66ef9c 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "parameters-spread" +PACKAGE_NAMESPACE = "parameters.spread" PACKAGE_PPRINT_NAME = "Parameters Spread" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/MANIFEST.in index dc7a7e5536d..5a3e215c4f4 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/contentnegotiation/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py index 2914d209c43..99074e69ebc 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import ContentNegotiationClientConfiguration @@ -112,7 +112,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: return deserialized # type: ignore - async def get_avatar_as_json(self, **kwargs: Any) -> _models2.PngImageAsJson: + async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: """get_avatar_as_json. :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping @@ -131,7 +131,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models2.PngImageAsJson: _params = kwargs.pop("params", {}) or {} accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models2.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) _request = build_different_body_get_avatar_as_json_request( accept=accept, @@ -163,7 +163,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models2.PngImageAsJson: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.PngImageAsJson, response.json()) + deserialized = _deserialize(_models.PngImageAsJson, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py index 2612d220b63..eac88145e4c 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import ContentNegotiationClientConfiguration from ..._model_base import _deserialize from ..._serialization import Deserializer, Serializer @@ -137,7 +137,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: return deserialized # type: ignore - def get_avatar_as_json(self, **kwargs: Any) -> _models1.PngImageAsJson: + def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: """get_avatar_as_json. :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping @@ -156,7 +156,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models1.PngImageAsJson: _params = kwargs.pop("params", {}) or {} accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models1.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) _request = build_different_body_get_avatar_as_json_request( accept=accept, @@ -188,7 +188,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models1.PngImageAsJson: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.PngImageAsJson, response.json()) + deserialized = _deserialize(_models.PngImageAsJson, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py index 4e5cd2ad0e5..2feb7711573 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-contentnegotiation" +PACKAGE_NAMESPACE = "payload.contentnegotiation" PACKAGE_PPRINT_NAME = "Payload Contentnegotiation" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/MANIFEST.in index a4b16dd0a5c..5294299b234 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/jsonmergepatch/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py index a71ba38af71..45bc2c5168c 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-jsonmergepatch" +PACKAGE_NAMESPACE = "payload.jsonmergepatch" PACKAGE_PPRINT_NAME = "Payload Jsonmergepatch" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-media-type/MANIFEST.in index 72b1c340a64..4c10e654b7f 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/mediatype/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py b/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py index fb74d1c390a..9fb923d3b81 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-mediatype" +PACKAGE_NAMESPACE = "payload.mediatype" PACKAGE_PPRINT_NAME = "Payload Mediatype" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-multipart/MANIFEST.in index c41546020da..022fdb3ee1f 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/multipart/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py index 77faf19d2fc..aaec50800bd 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from .... import _model_base, models as _models3 +from .... import _model_base, models as _models from ...._serialization import Deserializer, Serializer from ...._vendor import FileType, prepare_multipart_form_data from ....aio._configuration import MultiPartClientConfiguration @@ -65,7 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) @overload - async def basic(self, body: _models3.MultiPartRequest, **kwargs: Any) -> None: + async def basic(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -86,7 +86,7 @@ async def basic(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def basic(self, body: Union[_models3.MultiPartRequest, JSON], **kwargs: Any) -> None: + async def basic(self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Is either a MultiPartRequest type or a JSON type. Required. @@ -137,7 +137,7 @@ async def basic(self, body: Union[_models3.MultiPartRequest, JSON], **kwargs: An return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_array_and_basic(self, body: _models3.ComplexPartsRequest, **kwargs: Any) -> None: + async def file_array_and_basic(self, body: _models.ComplexPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -158,7 +158,7 @@ async def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def file_array_and_basic(self, body: Union[_models3.ComplexPartsRequest, JSON], **kwargs: Any) -> None: + async def file_array_and_basic(self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Is either a ComplexPartsRequest type or a JSON type. Required. @@ -209,7 +209,7 @@ async def file_array_and_basic(self, body: Union[_models3.ComplexPartsRequest, J return cls(pipeline_response, None, {}) # type: ignore @overload - async def json_part(self, body: _models3.JsonPartRequest, **kwargs: Any) -> None: + async def json_part(self, body: _models.JsonPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Required. @@ -230,7 +230,7 @@ async def json_part(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def json_part(self, body: Union[_models3.JsonPartRequest, JSON], **kwargs: Any) -> None: + async def json_part(self, body: Union[_models.JsonPartRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Is either a JsonPartRequest type or a JSON type. Required. @@ -281,7 +281,7 @@ async def json_part(self, body: Union[_models3.JsonPartRequest, JSON], **kwargs: return cls(pipeline_response, None, {}) # type: ignore @overload - async def binary_array_parts(self, body: _models3.BinaryArrayPartsRequest, **kwargs: Any) -> None: + async def binary_array_parts(self, body: _models.BinaryArrayPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -302,7 +302,7 @@ async def binary_array_parts(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def binary_array_parts(self, body: Union[_models3.BinaryArrayPartsRequest, JSON], **kwargs: Any) -> None: + async def binary_array_parts(self, body: Union[_models.BinaryArrayPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Is either a BinaryArrayPartsRequest type or a JSON type. Required. @@ -353,7 +353,7 @@ async def binary_array_parts(self, body: Union[_models3.BinaryArrayPartsRequest, return cls(pipeline_response, None, {}) # type: ignore @overload - async def multi_binary_parts(self, body: _models3.MultiBinaryPartsRequest, **kwargs: Any) -> None: + async def multi_binary_parts(self, body: _models.MultiBinaryPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -374,7 +374,7 @@ async def multi_binary_parts(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def multi_binary_parts(self, body: Union[_models3.MultiBinaryPartsRequest, JSON], **kwargs: Any) -> None: + async def multi_binary_parts(self, body: Union[_models.MultiBinaryPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Is either a MultiBinaryPartsRequest type or a JSON type. Required. @@ -425,7 +425,7 @@ async def multi_binary_parts(self, body: Union[_models3.MultiBinaryPartsRequest, return cls(pipeline_response, None, {}) # type: ignore @overload - async def check_file_name_and_content_type(self, body: _models3.MultiPartRequest, **kwargs: Any) -> None: + async def check_file_name_and_content_type(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -447,7 +447,7 @@ async def check_file_name_and_content_type(self, body: JSON, **kwargs: Any) -> N """ async def check_file_name_and_content_type( - self, body: Union[_models3.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py index a75c4bd09be..3d9439fa89b 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ..... import _model_base, models as _models4 +from ..... import _model_base, models as _models from ....._serialization import Deserializer, Serializer from ....._vendor import prepare_multipart_form_data from .....aio._configuration import MultiPartClientConfiguration @@ -62,7 +62,7 @@ def __init__(self, *args, **kwargs) -> None: ) @overload - async def json_array_and_file_array(self, body: _models4.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -84,7 +84,7 @@ async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: """ async def json_array_and_file_array( - self, body: Union[_models4.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py index 4e27eb0f486..cfe42f37966 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ...... import _model_base, models as _models5 +from ...... import _model_base, models as _models from ......_serialization import Deserializer, Serializer from ......_vendor import prepare_multipart_form_data from ......aio._configuration import MultiPartClientConfiguration @@ -58,7 +58,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def image_jpeg_content_type( - self, body: _models5.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any + self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -81,7 +81,7 @@ async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def image_jpeg_content_type( - self, body: Union[_models5.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -135,7 +135,7 @@ async def image_jpeg_content_type( @overload async def required_content_type( - self, body: _models5.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any + self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -158,7 +158,7 @@ async def required_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def required_content_type( - self, body: Union[_models5.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -212,7 +212,7 @@ async def required_content_type( @overload async def optional_content_type( - self, body: _models5.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any + self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -235,7 +235,7 @@ async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def optional_content_type( - self, body: Union[_models5.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py index 9bb28bc960e..1b1f8d4feb3 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ..... import _model_base, models as _models4 +from ..... import _model_base, models as _models from ....._configuration import MultiPartClientConfiguration from ....._serialization import Deserializer, Serializer from ....._vendor import prepare_multipart_form_data @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def image_jpeg_content_type(self, body: _models4.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: + def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -111,7 +111,7 @@ def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: """ def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models4.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -164,7 +164,7 @@ def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def required_content_type(self, body: _models4.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: + def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -186,7 +186,7 @@ def required_content_type(self, body: JSON, **kwargs: Any) -> None: """ def required_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models4.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -239,7 +239,7 @@ def required_content_type( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def optional_content_type(self, body: _models4.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: + def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for optional content type. :param body: Required. @@ -261,7 +261,7 @@ def optional_content_type(self, body: JSON, **kwargs: Any) -> None: """ def optional_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models4.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py index a6b3d03dd2e..110cf0dc104 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ... import models as _models2 +from ... import models as _models from ...... import _model_base from ......_serialization import Deserializer, Serializer from ......_vendor import prepare_multipart_form_data @@ -54,7 +54,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def float(self, body: _models2.FloatRequest, **kwargs: Any) -> None: + async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Required. @@ -75,7 +75,7 @@ async def float(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def float(self, body: Union[_models2.FloatRequest, JSON], **kwargs: Any) -> None: + async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Is either a FloatRequest type or a JSON type. Required. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py index 69c6252dc90..3e744752534 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..... import _model_base from ....._configuration import MultiPartClientConfiguration from ....._serialization import Deserializer, Serializer @@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def float(self, body: _models1.FloatRequest, **kwargs: Any) -> None: + def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Required. @@ -88,7 +88,7 @@ def float(self, body: JSON, **kwargs: Any) -> None: """ def float( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.FloatRequest, JSON], **kwargs: Any + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for non string. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py index 583437e6856..45de075f98b 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import _model_base, models as _models3 +from .... import _model_base, models as _models from ...._configuration import MultiPartClientConfiguration from ...._serialization import Deserializer, Serializer from ...._vendor import prepare_multipart_form_data @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs): ) @overload - def json_array_and_file_array(self, body: _models3.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -98,7 +98,7 @@ def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: """ def json_array_and_file_array( # pylint: disable=inconsistent-return-statements - self, body: Union[_models3.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py index a4622e9107b..a6af8a771f7 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import _model_base, models as _models2 +from ... import _model_base, models as _models from ..._configuration import MultiPartClientConfiguration from ..._serialization import Deserializer, Serializer from ..._vendor import FileType, prepare_multipart_form_data @@ -125,7 +125,7 @@ def __init__(self, *args, **kwargs): self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) @overload - def basic(self, body: _models2.MultiPartRequest, **kwargs: Any) -> None: + def basic(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -147,7 +147,7 @@ def basic(self, body: JSON, **kwargs: Any) -> None: """ def basic( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -199,7 +199,7 @@ def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def file_array_and_basic(self, body: _models2.ComplexPartsRequest, **kwargs: Any) -> None: + def file_array_and_basic(self, body: _models.ComplexPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -221,7 +221,7 @@ def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: """ def file_array_and_basic( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.ComplexPartsRequest, JSON], **kwargs: Any + self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -273,7 +273,7 @@ def file_array_and_basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def json_part(self, body: _models2.JsonPartRequest, **kwargs: Any) -> None: + def json_part(self, body: _models.JsonPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Required. @@ -295,7 +295,7 @@ def json_part(self, body: JSON, **kwargs: Any) -> None: """ def json_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.JsonPartRequest, JSON], **kwargs: Any + self, body: Union[_models.JsonPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. @@ -347,7 +347,7 @@ def json_part( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def binary_array_parts(self, body: _models2.BinaryArrayPartsRequest, **kwargs: Any) -> None: + def binary_array_parts(self, body: _models.BinaryArrayPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -369,7 +369,7 @@ def binary_array_parts(self, body: JSON, **kwargs: Any) -> None: """ def binary_array_parts( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.BinaryArrayPartsRequest, JSON], **kwargs: Any + self, body: Union[_models.BinaryArrayPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. @@ -421,7 +421,7 @@ def binary_array_parts( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def multi_binary_parts(self, body: _models2.MultiBinaryPartsRequest, **kwargs: Any) -> None: + def multi_binary_parts(self, body: _models.MultiBinaryPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -443,7 +443,7 @@ def multi_binary_parts(self, body: JSON, **kwargs: Any) -> None: """ def multi_binary_parts( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.MultiBinaryPartsRequest, JSON], **kwargs: Any + self, body: Union[_models.MultiBinaryPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. @@ -495,7 +495,7 @@ def multi_binary_parts( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def check_file_name_and_content_type(self, body: _models2.MultiPartRequest, **kwargs: Any) -> None: + def check_file_name_and_content_type(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -517,7 +517,7 @@ def check_file_name_and_content_type(self, body: JSON, **kwargs: Any) -> None: """ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models2.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py index 452d45b43bd..5b7ad8c4063 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-multipart" +PACKAGE_NAMESPACE = "payload.multipart" PACKAGE_PPRINT_NAME = "Payload Multipart" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-pageable/MANIFEST.in index f2e18952488..24d62ee29fd 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/pageable/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py index 0442497ba0b..5c5a753fbb6 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from .... import models as _models3 +from .... import models as _models from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import PageableClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: + def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: """link. :return: An iterator like instance of Pet @@ -67,7 +67,7 @@ def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -104,7 +104,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models3.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index 9a724a0b918..5b11ec9ae6a 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ..... import models as _models4 +from ..... import models as _models from ....._model_base import _deserialize from ....._serialization import Deserializer, Serializer from .....aio._configuration import PageableClientConfiguration @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: def request_query_response_body( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncIterable["_models.Pet"]: """request_query_response_body. :keyword token: Default value is None. @@ -75,7 +75,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models4.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) @@ -137,7 +137,7 @@ async def get_next(next_link=None): def request_header_response_body( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncIterable["_models.Pet"]: """request_header_response_body. :keyword token: Default value is None. @@ -153,7 +153,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -193,7 +193,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models4.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) @@ -215,7 +215,7 @@ async def get_next(next_link=None): def request_query_response_header( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncIterable["_models.Pet"]: """request_query_response_header. :keyword token: Default value is None. @@ -231,7 +231,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -271,7 +271,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models4.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) @@ -293,7 +293,7 @@ async def get_next(next_link=None): def request_header_response_header( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncIterable["_models.Pet"]: """request_header_response_header. :keyword token: Default value is None. @@ -309,7 +309,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -349,7 +349,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models4.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 9ee909164f6..30eeb20e5a6 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models3 +from .... import models as _models from ...._configuration import PageableClientConfiguration from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer @@ -158,7 +158,7 @@ def __init__(self, *args, **kwargs): def request_query_response_body( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> Iterable["_models.Pet"]: """request_query_response_body. :keyword token: Default value is None. @@ -174,7 +174,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -214,7 +214,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models3.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) @@ -236,7 +236,7 @@ def get_next(next_link=None): def request_header_response_body( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> Iterable["_models.Pet"]: """request_header_response_body. :keyword token: Default value is None. @@ -252,7 +252,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -292,7 +292,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models3.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) @@ -314,7 +314,7 @@ def get_next(next_link=None): def request_query_response_header( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> Iterable["_models.Pet"]: """request_query_response_header. :keyword token: Default value is None. @@ -330,7 +330,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -370,7 +370,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models3.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) @@ -392,7 +392,7 @@ def get_next(next_link=None): def request_header_response_header( self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> Iterable["_models.Pet"]: """request_header_response_header. :keyword token: Default value is None. @@ -408,7 +408,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -448,7 +448,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models3.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return None, iter(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py index 85ed9cc2bdd..db18a057bdd 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._configuration import PageableClientConfiguration from ..._model_base import _deserialize from ..._serialization import Deserializer, Serializer @@ -74,7 +74,7 @@ def __init__(self, *args, **kwargs): self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: + def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: """link. :return: An iterator like instance of Pet @@ -84,7 +84,7 @@ def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -121,7 +121,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py index d6bbb04b6ea..38b79a86f00 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-pageable" +PACKAGE_NAMESPACE = "payload.pageable" PACKAGE_PPRINT_NAME = "Payload Pageable" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-xml/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/payload-xml/MANIFEST.in index 07a0c716455..ef8f20ba112 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-xml/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/payload-xml/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include payload/xml/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include payload/__init__.py \ No newline at end of file +include payload/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py b/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py index a588cd7a4a4..b9eb68e2ed4 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "payload-xml" +PACKAGE_NAMESPACE = "payload.xml" PACKAGE_PPRINT_NAME = "Payload Xml" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/response-status-code-range/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/response-status-code-range/MANIFEST.in index 87b2b3fe020..3b3539da09f 100644 --- a/packages/typespec-python/test/unbranded/generated/response-status-code-range/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/response-status-code-range/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include response/statuscoderange/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include response/__init__.py \ No newline at end of file +include response/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py b/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py index 34ab0f06afb..05b05fc599e 100644 --- a/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py +++ b/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "response-statuscoderange" +PACKAGE_NAMESPACE = "response.statuscoderange" PACKAGE_PPRINT_NAME = "Response Statuscoderange" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in index d3777f92f7f..0d81e3a9d35 100644 --- a/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include routes/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/unbranded/generated/routes/setup.py b/packages/typespec-python/test/unbranded/generated/routes/setup.py index 22d8a517c4d..36aef74c500 100644 --- a/packages/typespec-python/test/unbranded/generated/routes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/routes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "routes" +PACKAGE_NAMESPACE = "routes" PACKAGE_PPRINT_NAME = "Routes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/MANIFEST.in index ae346d7ed79..129d71d3353 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/MANIFEST.in @@ -4,4 +4,4 @@ include serialization/encodedname/json/py.typed recursive-include tests *.py recursive-include samples *.py *.md include serialization/__init__.py -include serialization/encodedname/__init__.py \ No newline at end of file +include serialization/encodedname/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py index deb729c5934..c8af34e7982 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import JsonClientConfiguration @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def send( - self, body: _models2.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """send. @@ -101,7 +101,7 @@ async def send(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def send(self, body: Union[_models2.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def send(self, body: Union[_models.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any) -> None: """send. :param body: Is one of the following types: JsonEncodedNameModel, JSON, IO[bytes] Required. @@ -154,7 +154,7 @@ async def send(self, body: Union[_models2.JsonEncodedNameModel, JSON, IO[bytes]] if cls: return cls(pipeline_response, None, {}) # type: ignore - async def get(self, **kwargs: Any) -> _models2.JsonEncodedNameModel: + async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: """get. :return: JsonEncodedNameModel. The JsonEncodedNameModel is compatible with MutableMapping @@ -172,7 +172,7 @@ async def get(self, **kwargs: Any) -> _models2.JsonEncodedNameModel: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.JsonEncodedNameModel] = kwargs.pop("cls", None) + cls: ClsType[_models.JsonEncodedNameModel] = kwargs.pop("cls", None) _request = build_property_get_request( headers=_headers, @@ -200,7 +200,7 @@ async def get(self, **kwargs: Any) -> _models2.JsonEncodedNameModel: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.JsonEncodedNameModel, response.json()) + deserialized = _deserialize(_models.JsonEncodedNameModel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py index 12bb514d9c5..cc4e4d32208 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import JsonClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs): @overload def send( - self, body: _models1.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """send. @@ -132,7 +132,7 @@ def send(self, body: IO[bytes], *, content_type: str = "application/json", **kwa """ def send( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """send. @@ -186,7 +186,7 @@ def send( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore - def get(self, **kwargs: Any) -> _models1.JsonEncodedNameModel: + def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: """get. :return: JsonEncodedNameModel. The JsonEncodedNameModel is compatible with MutableMapping @@ -204,7 +204,7 @@ def get(self, **kwargs: Any) -> _models1.JsonEncodedNameModel: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.JsonEncodedNameModel] = kwargs.pop("cls", None) + cls: ClsType[_models.JsonEncodedNameModel] = kwargs.pop("cls", None) _request = build_property_get_request( headers=_headers, @@ -232,7 +232,7 @@ def get(self, **kwargs: Any) -> _models1.JsonEncodedNameModel: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.JsonEncodedNameModel, response.json()) + deserialized = _deserialize(_models.JsonEncodedNameModel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py index db84f208bbf..fa695262c64 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "serialization-encodedname-json" +PACKAGE_NAMESPACE = "serialization.encodedname.json" PACKAGE_PPRINT_NAME = "Serialization Encodedname Json" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/MANIFEST.in index 3fb7e5ef0a6..f1826052a5d 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/MANIFEST.in @@ -4,4 +4,4 @@ include server/endpoint/notdefined/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/endpoint/__init__.py \ No newline at end of file +include server/endpoint/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py index bc2f60874b5..8e1a19aaee3 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-endpoint-notdefined" +PACKAGE_NAMESPACE = "server.endpoint.notdefined" PACKAGE_PPRINT_NAME = "Server Endpoint Notdefined" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/server-path-multiple/MANIFEST.in index 543f941fab6..56d253b0ae2 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/MANIFEST.in @@ -4,4 +4,4 @@ include server/path/multiple/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/path/__init__.py \ No newline at end of file +include server/path/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py index 0c56047e89d..15d5861922c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-path-multiple" +PACKAGE_NAMESPACE = "server.path.multiple" PACKAGE_PPRINT_NAME = "Server Path Multiple" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/server-path-single/MANIFEST.in index 973c402a023..d3262e4af86 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/MANIFEST.in @@ -4,4 +4,4 @@ include server/path/single/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/path/__init__.py \ No newline at end of file +include server/path/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py b/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py index dcb4599123e..994f0202393 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-path-single" +PACKAGE_NAMESPACE = "server.path.single" PACKAGE_PPRINT_NAME = "Server Path Single" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/MANIFEST.in index cb00091dc98..03251cbd03c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/MANIFEST.in @@ -4,4 +4,4 @@ include server/versions/notversioned/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/versions/__init__.py \ No newline at end of file +include server/versions/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py index 7750eac17ce..5a56d33eec9 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-versions-notversioned" +PACKAGE_NAMESPACE = "server.versions.notversioned" PACKAGE_PPRINT_NAME = "Server Versions Notversioned" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/MANIFEST.in index 7779034f76c..914710e6ed5 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/MANIFEST.in @@ -4,4 +4,4 @@ include server/versions/versioned/py.typed recursive-include tests *.py recursive-include samples *.py *.md include server/__init__.py -include server/versions/__init__.py \ No newline at end of file +include server/versions/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py index b9f424233c1..52144a95487 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "server-versions-versioned" +PACKAGE_NAMESPACE = "server.versions.versioned" PACKAGE_PPRINT_NAME = "Server Versions Versioned" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/MANIFEST.in index f9e928ca45b..fc707cbe7eb 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include specialheaders/conditionalrequest/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include specialheaders/__init__.py \ No newline at end of file +include specialheaders/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py index 77db397e1af..e5ba2e7ea32 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialheaders-conditionalrequest" +PACKAGE_NAMESPACE = "specialheaders.conditionalrequest" PACKAGE_PPRINT_NAME = "Specialheaders Conditionalrequest" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/MANIFEST.in index 237a98837bc..e7e275be2ba 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include specialheaders/repeatability/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include specialheaders/__init__.py \ No newline at end of file +include specialheaders/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py index b029b71fd31..52ea34bee36 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialheaders-repeatability" +PACKAGE_NAMESPACE = "specialheaders.repeatability" PACKAGE_PPRINT_NAME = "Specialheaders Repeatability" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-words/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/special-words/MANIFEST.in index fa4fcb28a3e..0bd139fa00a 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/special-words/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include specialwords/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/typespec-python/test/unbranded/generated/special-words/setup.py b/packages/typespec-python/test/unbranded/generated/special-words/setup.py index 8276b5b27b7..d384daf717e 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "specialwords" +PACKAGE_NAMESPACE = "specialwords" PACKAGE_PPRINT_NAME = "Specialwords" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py index 921cdbbd1fd..32ae84db670 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpecialWordsClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def same_as_model( - self, body: _models2.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """same_as_model. @@ -99,7 +99,7 @@ async def same_as_model(self, body: IO[bytes], *, content_type: str = "applicati :raises ~corehttp.exceptions.HttpResponseError: """ - async def same_as_model(self, body: Union[_models2.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """same_as_model. :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py index 85a195de972..e2aff5d9d8a 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import SpecialWordsClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -73,7 +73,7 @@ def __init__(self, *args, **kwargs): @overload def same_as_model( - self, body: _models1.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """same_as_model. @@ -116,7 +116,7 @@ def same_as_model(self, body: IO[bytes], *, content_type: str = "application/jso """ def same_as_model( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.SameAsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """same_as_model. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py index c79d16826c7..07567462188 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py @@ -24,7 +24,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpecialWordsClientConfiguration @@ -91,7 +91,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def with_and(self, body: _models2.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_and. :param body: Required. @@ -132,7 +132,7 @@ async def with_and(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_and(self, body: Union[_models2.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_and. :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. @@ -186,7 +186,7 @@ async def with_and(self, body: Union[_models2.AndModel, JSON, IO[bytes]], **kwar return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_as(self, body: _models2.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_as. :param body: Required. @@ -227,7 +227,7 @@ async def with_as(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_as(self, body: Union[_models2.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_as. :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. @@ -282,7 +282,7 @@ async def with_as(self, body: Union[_models2.AsModel, JSON, IO[bytes]], **kwargs @overload async def with_assert( - self, body: _models2.AssertModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_assert. @@ -324,7 +324,7 @@ async def with_assert(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_assert(self, body: Union[_models2.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_assert. :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. @@ -379,7 +379,7 @@ async def with_assert(self, body: Union[_models2.AssertModel, JSON, IO[bytes]], @overload async def with_async( - self, body: _models2.AsyncModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_async. @@ -421,7 +421,7 @@ async def with_async(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_async(self, body: Union[_models2.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_async. :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. @@ -476,7 +476,7 @@ async def with_async(self, body: Union[_models2.AsyncModel, JSON, IO[bytes]], ** @overload async def with_await( - self, body: _models2.AwaitModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_await. @@ -518,7 +518,7 @@ async def with_await(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_await(self, body: Union[_models2.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_await. :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. @@ -573,7 +573,7 @@ async def with_await(self, body: Union[_models2.AwaitModel, JSON, IO[bytes]], ** @overload async def with_break( - self, body: _models2.BreakModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_break. @@ -615,7 +615,7 @@ async def with_break(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_break(self, body: Union[_models2.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_break. :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. @@ -670,7 +670,7 @@ async def with_break(self, body: Union[_models2.BreakModel, JSON, IO[bytes]], ** @overload async def with_class( - self, body: _models2.ClassModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_class. @@ -712,7 +712,7 @@ async def with_class(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_class(self, body: Union[_models2.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_class. :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. @@ -767,7 +767,7 @@ async def with_class(self, body: Union[_models2.ClassModel, JSON, IO[bytes]], ** @overload async def with_constructor( - self, body: _models2.Constructor, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_constructor. @@ -809,7 +809,7 @@ async def with_constructor(self, body: IO[bytes], *, content_type: str = "applic :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_constructor(self, body: Union[_models2.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: """with_constructor. :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. @@ -864,7 +864,7 @@ async def with_constructor(self, body: Union[_models2.Constructor, JSON, IO[byte @overload async def with_continue( - self, body: _models2.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_continue. @@ -906,7 +906,7 @@ async def with_continue(self, body: IO[bytes], *, content_type: str = "applicati :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_continue(self, body: Union[_models2.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_continue. :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. @@ -960,7 +960,7 @@ async def with_continue(self, body: Union[_models2.ContinueModel, JSON, IO[bytes return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_def(self, body: _models2.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_def. :param body: Required. @@ -1001,7 +1001,7 @@ async def with_def(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_def(self, body: Union[_models2.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_def. :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. @@ -1055,7 +1055,7 @@ async def with_def(self, body: Union[_models2.DefModel, JSON, IO[bytes]], **kwar return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_del(self, body: _models2.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_del. :param body: Required. @@ -1096,7 +1096,7 @@ async def with_del(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_del(self, body: Union[_models2.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_del. :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. @@ -1151,7 +1151,7 @@ async def with_del(self, body: Union[_models2.DelModel, JSON, IO[bytes]], **kwar @overload async def with_elif( - self, body: _models2.ElifModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_elif. @@ -1193,7 +1193,7 @@ async def with_elif(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_elif(self, body: Union[_models2.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_elif. :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. @@ -1248,7 +1248,7 @@ async def with_elif(self, body: Union[_models2.ElifModel, JSON, IO[bytes]], **kw @overload async def with_else( - self, body: _models2.ElseModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_else. @@ -1290,7 +1290,7 @@ async def with_else(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_else(self, body: Union[_models2.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_else. :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. @@ -1345,7 +1345,7 @@ async def with_else(self, body: Union[_models2.ElseModel, JSON, IO[bytes]], **kw @overload async def with_except( - self, body: _models2.ExceptModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_except. @@ -1387,7 +1387,7 @@ async def with_except(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_except(self, body: Union[_models2.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_except. :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. @@ -1442,7 +1442,7 @@ async def with_except(self, body: Union[_models2.ExceptModel, JSON, IO[bytes]], @overload async def with_exec( - self, body: _models2.ExecModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_exec. @@ -1484,7 +1484,7 @@ async def with_exec(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_exec(self, body: Union[_models2.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_exec. :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. @@ -1539,7 +1539,7 @@ async def with_exec(self, body: Union[_models2.ExecModel, JSON, IO[bytes]], **kw @overload async def with_finally( - self, body: _models2.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_finally. @@ -1581,7 +1581,7 @@ async def with_finally(self, body: IO[bytes], *, content_type: str = "applicatio :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_finally(self, body: Union[_models2.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_finally. :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. @@ -1635,7 +1635,7 @@ async def with_finally(self, body: Union[_models2.FinallyModel, JSON, IO[bytes]] return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_for(self, body: _models2.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_for. :param body: Required. @@ -1676,7 +1676,7 @@ async def with_for(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_for(self, body: Union[_models2.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_for. :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. @@ -1731,7 +1731,7 @@ async def with_for(self, body: Union[_models2.ForModel, JSON, IO[bytes]], **kwar @overload async def with_from( - self, body: _models2.FromModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_from. @@ -1773,7 +1773,7 @@ async def with_from(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_from(self, body: Union[_models2.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_from. :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. @@ -1828,7 +1828,7 @@ async def with_from(self, body: Union[_models2.FromModel, JSON, IO[bytes]], **kw @overload async def with_global( - self, body: _models2.GlobalModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_global. @@ -1870,7 +1870,7 @@ async def with_global(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_global(self, body: Union[_models2.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_global. :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. @@ -1924,7 +1924,7 @@ async def with_global(self, body: Union[_models2.GlobalModel, JSON, IO[bytes]], return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_if(self, body: _models2.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_if. :param body: Required. @@ -1965,7 +1965,7 @@ async def with_if(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_if(self, body: Union[_models2.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_if. :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. @@ -2020,7 +2020,7 @@ async def with_if(self, body: Union[_models2.IfModel, JSON, IO[bytes]], **kwargs @overload async def with_import( - self, body: _models2.ImportModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_import. @@ -2062,7 +2062,7 @@ async def with_import(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_import(self, body: Union[_models2.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_import. :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. @@ -2116,7 +2116,7 @@ async def with_import(self, body: Union[_models2.ImportModel, JSON, IO[bytes]], return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_in(self, body: _models2.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_in. :param body: Required. @@ -2157,7 +2157,7 @@ async def with_in(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_in(self, body: Union[_models2.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_in. :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. @@ -2211,7 +2211,7 @@ async def with_in(self, body: Union[_models2.InModel, JSON, IO[bytes]], **kwargs return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_is(self, body: _models2.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_is. :param body: Required. @@ -2252,7 +2252,7 @@ async def with_is(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_is(self, body: Union[_models2.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_is. :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. @@ -2307,7 +2307,7 @@ async def with_is(self, body: Union[_models2.IsModel, JSON, IO[bytes]], **kwargs @overload async def with_lambda( - self, body: _models2.LambdaModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_lambda. @@ -2349,7 +2349,7 @@ async def with_lambda(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_lambda(self, body: Union[_models2.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_lambda. :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. @@ -2403,7 +2403,7 @@ async def with_lambda(self, body: Union[_models2.LambdaModel, JSON, IO[bytes]], return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_not(self, body: _models2.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_not. :param body: Required. @@ -2444,7 +2444,7 @@ async def with_not(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_not(self, body: Union[_models2.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_not. :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. @@ -2498,7 +2498,7 @@ async def with_not(self, body: Union[_models2.NotModel, JSON, IO[bytes]], **kwar return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_or(self, body: _models2.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_or. :param body: Required. @@ -2539,7 +2539,7 @@ async def with_or(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_or(self, body: Union[_models2.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_or. :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. @@ -2594,7 +2594,7 @@ async def with_or(self, body: Union[_models2.OrModel, JSON, IO[bytes]], **kwargs @overload async def with_pass( - self, body: _models2.PassModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_pass. @@ -2636,7 +2636,7 @@ async def with_pass(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_pass(self, body: Union[_models2.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_pass. :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. @@ -2691,7 +2691,7 @@ async def with_pass(self, body: Union[_models2.PassModel, JSON, IO[bytes]], **kw @overload async def with_raise( - self, body: _models2.RaiseModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_raise. @@ -2733,7 +2733,7 @@ async def with_raise(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_raise(self, body: Union[_models2.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_raise. :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. @@ -2788,7 +2788,7 @@ async def with_raise(self, body: Union[_models2.RaiseModel, JSON, IO[bytes]], ** @overload async def with_return( - self, body: _models2.ReturnModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_return. @@ -2830,7 +2830,7 @@ async def with_return(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_return(self, body: Union[_models2.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_return. :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. @@ -2884,7 +2884,7 @@ async def with_return(self, body: Union[_models2.ReturnModel, JSON, IO[bytes]], return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_try(self, body: _models2.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_try. :param body: Required. @@ -2925,7 +2925,7 @@ async def with_try(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_try(self, body: Union[_models2.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_try. :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. @@ -2980,7 +2980,7 @@ async def with_try(self, body: Union[_models2.TryModel, JSON, IO[bytes]], **kwar @overload async def with_while( - self, body: _models2.WhileModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_while. @@ -3022,7 +3022,7 @@ async def with_while(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_while(self, body: Union[_models2.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_while. :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. @@ -3077,7 +3077,7 @@ async def with_while(self, body: Union[_models2.WhileModel, JSON, IO[bytes]], ** @overload async def with_with( - self, body: _models2.WithModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_with. @@ -3119,7 +3119,7 @@ async def with_with(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_with(self, body: Union[_models2.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_with. :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. @@ -3174,7 +3174,7 @@ async def with_with(self, body: Union[_models2.WithModel, JSON, IO[bytes]], **kw @overload async def with_yield( - self, body: _models2.YieldModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_yield. @@ -3216,7 +3216,7 @@ async def with_yield(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_yield(self, body: Union[_models2.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_yield. :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py index a1b9c14e28d..8459e0f2bd5 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py @@ -24,7 +24,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from ..._configuration import SpecialWordsClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -521,7 +521,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def with_and(self, body: _models1.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_and. :param body: Required. @@ -563,7 +563,7 @@ def with_and(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_and( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.AndModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_and. @@ -618,7 +618,7 @@ def with_and( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_as(self, body: _models1.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_as. :param body: Required. @@ -660,7 +660,7 @@ def with_as(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_as( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.AsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_as. @@ -715,7 +715,7 @@ def with_as( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_assert(self, body: _models1.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_assert. :param body: Required. @@ -757,7 +757,7 @@ def with_assert(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_assert( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.AssertModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_assert. @@ -812,7 +812,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_async(self, body: _models1.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_async. :param body: Required. @@ -854,7 +854,7 @@ def with_async(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_async( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.AsyncModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_async. @@ -909,7 +909,7 @@ def with_async( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_await(self, body: _models1.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_await. :param body: Required. @@ -951,7 +951,7 @@ def with_await(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_await( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.AwaitModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_await. @@ -1006,7 +1006,7 @@ def with_await( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_break(self, body: _models1.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_break. :param body: Required. @@ -1048,7 +1048,7 @@ def with_break(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_break( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.BreakModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_break. @@ -1103,7 +1103,7 @@ def with_break( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_class(self, body: _models1.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_class. :param body: Required. @@ -1145,7 +1145,7 @@ def with_class(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_class( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ClassModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_class. @@ -1201,7 +1201,7 @@ def with_class( # pylint: disable=inconsistent-return-statements @overload def with_constructor( - self, body: _models1.Constructor, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_constructor. @@ -1244,7 +1244,7 @@ def with_constructor(self, body: IO[bytes], *, content_type: str = "application/ """ def with_constructor( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.Constructor, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_constructor. @@ -1300,7 +1300,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements @overload def with_continue( - self, body: _models1.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_continue. @@ -1343,7 +1343,7 @@ def with_continue(self, body: IO[bytes], *, content_type: str = "application/jso """ def with_continue( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ContinueModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_continue. @@ -1398,7 +1398,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_def(self, body: _models1.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_def. :param body: Required. @@ -1440,7 +1440,7 @@ def with_def(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_def( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.DefModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_def. @@ -1495,7 +1495,7 @@ def with_def( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_del(self, body: _models1.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_del. :param body: Required. @@ -1537,7 +1537,7 @@ def with_del(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_del( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.DelModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_del. @@ -1592,7 +1592,7 @@ def with_del( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_elif(self, body: _models1.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_elif. :param body: Required. @@ -1634,7 +1634,7 @@ def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_elif( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ElifModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_elif. @@ -1689,7 +1689,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_else(self, body: _models1.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_else. :param body: Required. @@ -1731,7 +1731,7 @@ def with_else(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_else( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ElseModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_else. @@ -1786,7 +1786,7 @@ def with_else( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_except(self, body: _models1.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_except. :param body: Required. @@ -1828,7 +1828,7 @@ def with_except(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_except( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ExceptModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_except. @@ -1883,7 +1883,7 @@ def with_except( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_exec(self, body: _models1.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_exec. :param body: Required. @@ -1925,7 +1925,7 @@ def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_exec( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ExecModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_exec. @@ -1981,7 +1981,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements @overload def with_finally( - self, body: _models1.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_finally. @@ -2024,7 +2024,7 @@ def with_finally(self, body: IO[bytes], *, content_type: str = "application/json """ def with_finally( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.FinallyModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_finally. @@ -2079,7 +2079,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_for(self, body: _models1.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_for. :param body: Required. @@ -2121,7 +2121,7 @@ def with_for(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_for( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ForModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_for. @@ -2176,7 +2176,7 @@ def with_for( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_from(self, body: _models1.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_from. :param body: Required. @@ -2218,7 +2218,7 @@ def with_from(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_from( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.FromModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_from. @@ -2273,7 +2273,7 @@ def with_from( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_global(self, body: _models1.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_global. :param body: Required. @@ -2315,7 +2315,7 @@ def with_global(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_global( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.GlobalModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_global. @@ -2370,7 +2370,7 @@ def with_global( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_if(self, body: _models1.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_if. :param body: Required. @@ -2412,7 +2412,7 @@ def with_if(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_if( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.IfModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_if. @@ -2467,7 +2467,7 @@ def with_if( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_import(self, body: _models1.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_import. :param body: Required. @@ -2509,7 +2509,7 @@ def with_import(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_import( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ImportModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_import. @@ -2564,7 +2564,7 @@ def with_import( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_in(self, body: _models1.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_in. :param body: Required. @@ -2606,7 +2606,7 @@ def with_in(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_in( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.InModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_in. @@ -2661,7 +2661,7 @@ def with_in( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_is(self, body: _models1.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_is. :param body: Required. @@ -2703,7 +2703,7 @@ def with_is(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_is( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.IsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_is. @@ -2758,7 +2758,7 @@ def with_is( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_lambda(self, body: _models1.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_lambda. :param body: Required. @@ -2800,7 +2800,7 @@ def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_lambda( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.LambdaModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_lambda. @@ -2855,7 +2855,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_not(self, body: _models1.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_not. :param body: Required. @@ -2897,7 +2897,7 @@ def with_not(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_not( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.NotModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_not. @@ -2952,7 +2952,7 @@ def with_not( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_or(self, body: _models1.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_or. :param body: Required. @@ -2994,7 +2994,7 @@ def with_or(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_or( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.OrModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_or. @@ -3049,7 +3049,7 @@ def with_or( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_pass(self, body: _models1.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_pass. :param body: Required. @@ -3091,7 +3091,7 @@ def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_pass( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.PassModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_pass. @@ -3146,7 +3146,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_raise(self, body: _models1.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_raise. :param body: Required. @@ -3188,7 +3188,7 @@ def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_raise( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.RaiseModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_raise. @@ -3243,7 +3243,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_return(self, body: _models1.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_return. :param body: Required. @@ -3285,7 +3285,7 @@ def with_return(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_return( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.ReturnModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_return. @@ -3340,7 +3340,7 @@ def with_return( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_try(self, body: _models1.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_try. :param body: Required. @@ -3382,7 +3382,7 @@ def with_try(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_try( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.TryModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_try. @@ -3437,7 +3437,7 @@ def with_try( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_while(self, body: _models1.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_while. :param body: Required. @@ -3479,7 +3479,7 @@ def with_while(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_while( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.WhileModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_while. @@ -3534,7 +3534,7 @@ def with_while( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_with(self, body: _models1.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_with. :param body: Required. @@ -3576,7 +3576,7 @@ def with_with(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_with( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.WithModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_with. @@ -3631,7 +3631,7 @@ def with_with( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_yield(self, body: _models1.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_yield. :param body: Required. @@ -3673,7 +3673,7 @@ def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_yield( # pylint: disable=inconsistent-return-statements - self, body: Union[_models1.YieldModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_yield. diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-array/MANIFEST.in index a465968cb1a..23611f20002 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/array/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py index 4257088d006..582f80e49b1 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-array" +PACKAGE_NAMESPACE = "typetest.array" PACKAGE_PPRINT_NAME = "Typetest Array" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/MANIFEST.in index 2194c3bd9fe..8d989eb529c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/dictionary/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py index 4e6f2fb5188..7b523bc354f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-dictionary" +PACKAGE_NAMESPACE = "typetest.dictionary" PACKAGE_PPRINT_NAME = "Typetest Dictionary" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/MANIFEST.in index cadf7e31a1b..51fb6ca25f7 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/enum/extensible/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/enum/__init__.py \ No newline at end of file +include typetest/enum/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py index c90270498e2..d194279140a 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-enum-extensible" +PACKAGE_NAMESPACE = "typetest.enum.extensible" PACKAGE_PPRINT_NAME = "Typetest Enum Extensible" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/MANIFEST.in index b60b55cdab3..577b197e8e9 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/enum/fixed/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/enum/__init__.py \ No newline at end of file +include typetest/enum/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py index 4db727616a0..6aadc36c7e4 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-enum-fixed" +PACKAGE_NAMESPACE = "typetest.enum.fixed" PACKAGE_PPRINT_NAME = "Typetest Enum Fixed" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/MANIFEST.in index 79c41726e37..5cd1e0e87ab 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/empty/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py index f5217e3116f..a11180c918a 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-empty" +PACKAGE_NAMESPACE = "typetest.model.empty" PACKAGE_PPRINT_NAME = "Typetest Model Empty" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/MANIFEST.in index a755cad0130..c88f38a9557 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/enumdiscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py index 436aec6f304..1db10e2ca19 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-enumdiscriminator" +PACKAGE_NAMESPACE = "typetest.model.enumdiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Enumdiscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/MANIFEST.in index b555114e4a7..8a9c735394b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/nesteddiscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py index 8fc1fa56e32..c1485ceb2a5 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-nesteddiscriminator" +PACKAGE_NAMESPACE = "typetest.model.nesteddiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Nesteddiscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/MANIFEST.in index 16b644339ea..47fc2574304 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/notdiscriminated/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py index 0b6ac56b9a2..c968d3b33f6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-notdiscriminated" +PACKAGE_NAMESPACE = "typetest.model.notdiscriminated" PACKAGE_PPRINT_NAME = "Typetest Model Notdiscriminated" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/MANIFEST.in index 2d44c39bf33..95276adaa97 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/recursive/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py index 60b4b1cd2c7..e885c213974 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-recursive" +PACKAGE_NAMESPACE = "typetest.model.recursive" PACKAGE_PPRINT_NAME = "Typetest Model Recursive" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/MANIFEST.in index 0eab23be467..2cea11d5ea8 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/singlediscriminator/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py index 62931effded..bf97f5f5bee 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-singlediscriminator" +PACKAGE_NAMESPACE = "typetest.model.singlediscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Singlediscriminator" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/MANIFEST.in index 47ea6680c9a..d042ddbf08c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/usage/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py index e28fa125f57..228646783c8 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-usage" +PACKAGE_NAMESPACE = "typetest.model.usage" PACKAGE_PPRINT_NAME = "Typetest Model Usage" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/MANIFEST.in index 23933c60348..13cad0d7ff6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/model/visibility/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/model/__init__.py \ No newline at end of file +include typetest/model/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py index a801e230e43..3788797c38c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-model-visibility" +PACKAGE_NAMESPACE = "typetest.model.visibility" PACKAGE_PPRINT_NAME = "Typetest Model Visibility" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/MANIFEST.in index 57dd89e3dbe..f336dd88dac 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/additionalproperties/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py index 460cb6fcc9e..9eb5026e378 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-additionalproperties" +PACKAGE_NAMESPACE = "typetest.property.additionalproperties" PACKAGE_PPRINT_NAME = "Typetest Property Additionalproperties" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/MANIFEST.in index a0b21fd6e5b..9c6af5b254e 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/nullable/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py index 1c2ec951ef2..735c89589e3 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-nullable" +PACKAGE_NAMESPACE = "typetest.property.nullable" PACKAGE_PPRINT_NAME = "Typetest Property Nullable" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/MANIFEST.in index 7de1ad09fbc..2b81dc34d38 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/optional/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py index 854209e288a..a5b5040fc65 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-optional" +PACKAGE_NAMESPACE = "typetest.property.optional" PACKAGE_PPRINT_NAME = "Typetest Property Optional" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/MANIFEST.in index de3b3dbb96f..1168e7f57aa 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/MANIFEST.in @@ -4,4 +4,4 @@ include typetest/property/valuetypes/py.typed recursive-include tests *.py recursive-include samples *.py *.md include typetest/__init__.py -include typetest/property/__init__.py \ No newline at end of file +include typetest/property/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py index 2953040cf11..a7cf0bfc898 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-property-valuetypes" +PACKAGE_NAMESPACE = "typetest.property.valuetypes" PACKAGE_PPRINT_NAME = "Typetest Property Valuetypes" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-scalar/MANIFEST.in index a58aab400ed..61880ef6cba 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/scalar/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py index 12680f01d12..97427442269 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-scalar" +PACKAGE_NAMESPACE = "typetest.scalar" PACKAGE_PPRINT_NAME = "Typetest Scalar" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/typetest-union/MANIFEST.in index e66a3e513b1..607206a947f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include typetest/union/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include typetest/__init__.py \ No newline at end of file +include typetest/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py index f60b45849d3..36d161b1dab 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "typetest-union" +PACKAGE_NAMESPACE = "typetest.union" PACKAGE_PPRINT_NAME = "Typetest Union" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py index 6e4d31c08fc..a157ee56b1f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -80,11 +80,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -98,7 +98,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -126,7 +126,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -259,11 +259,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -277,7 +277,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -305,7 +305,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -440,11 +440,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -458,7 +458,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -486,7 +486,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -625,11 +625,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -643,7 +643,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -671,7 +671,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -800,11 +800,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -818,7 +818,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -846,7 +846,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -973,11 +973,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -991,7 +991,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1019,7 +1019,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1150,11 +1150,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1168,7 +1168,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1196,7 +1196,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1327,11 +1327,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1345,7 +1345,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1373,7 +1373,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1504,11 +1504,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1522,7 +1522,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1550,7 +1550,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1681,11 +1681,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1699,7 +1699,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1727,7 +1727,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py index a19ab397c1c..bb1f50ee741 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py @@ -112,18 +112,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload @@ -140,18 +140,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -168,18 +170,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -196,18 +200,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -224,18 +228,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -252,18 +256,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -280,18 +284,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -308,20 +312,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -338,20 +340,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -368,18 +368,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py index 7d8f501cedc..a7d231500f0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py @@ -341,11 +341,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -359,7 +359,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -387,7 +387,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -518,11 +518,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -536,7 +536,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -564,7 +564,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -699,11 +699,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -717,7 +717,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -745,7 +745,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -884,11 +884,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -902,7 +902,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -930,7 +930,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1059,11 +1059,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1077,7 +1077,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1105,7 +1105,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1234,11 +1234,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1252,7 +1252,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1280,7 +1280,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1411,11 +1411,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1429,7 +1429,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1457,7 +1457,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1586,11 +1586,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1604,7 +1604,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1632,7 +1632,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1761,11 +1761,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1779,7 +1779,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1807,7 +1807,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1936,11 +1936,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1954,7 +1954,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1982,7 +1982,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-added/MANIFEST.in index b1be260c62a..53ff76c3a87 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/added/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py index 639873619a5..378f59769f2 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-added" +PACKAGE_NAMESPACE = "versioning.added" PACKAGE_PPRINT_NAME = "Versioning Added" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/MANIFEST.in index 0fe89d7fd9e..0c3e336fcef 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/madeoptional/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py index 94c96057f0e..55aac7332ff 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-madeoptional" +PACKAGE_NAMESPACE = "versioning.madeoptional" PACKAGE_PPRINT_NAME = "Versioning Madeoptional" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-removed/MANIFEST.in index fac2b952d50..85d3fb2ce8c 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/removed/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py index b3cf852415a..c9cdb6e7cde 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-removed" +PACKAGE_NAMESPACE = "versioning.removed" PACKAGE_PPRINT_NAME = "Versioning Removed" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/MANIFEST.in index e8853b0efa9..68c9d666a33 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/renamedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py index 94d62cbbe54..ac2db22faa9 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-renamedfrom" +PACKAGE_NAMESPACE = "versioning.renamedfrom" PACKAGE_PPRINT_NAME = "Versioning Renamedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/MANIFEST.in index 9908ce3b143..d097edf0a73 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/returntypechangedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py index 9fbe67d3060..371a9259c46 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-returntypechangedfrom" +PACKAGE_NAMESPACE = "versioning.returntypechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Returntypechangedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/MANIFEST.in index 9d66ecf8fe3..667a92076b0 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include versioning/typechangedfrom/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include versioning/__init__.py \ No newline at end of file +include versioning/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py index 1340ded6d5e..09dbba5cd7d 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py @@ -13,10 +13,11 @@ PACKAGE_NAME = "versioning-typechangedfrom" +PACKAGE_NAMESPACE = "versioning.typechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Typechangedfrom" -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") +# a.b.c => a/b/c +package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -24,8 +25,6 @@ if not version: raise RuntimeError("Cannot find version information") - - setup( name=PACKAGE_NAME, version=version, From 6fad9301b8c34e8d1852cb67f5b51be2d20272aa Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 17 Mar 2025 08:32:13 +0000 Subject: [PATCH 04/13] update --- packages/typespec-python/package.json | 56 +- .../typespec-python/scripts/eng/regenerate.ts | 60 +- .../apiview-properties.json | 8 +- .../clientgenerator/core/access/_client.py | 10 +- .../core/access/aio/_client.py | 10 +- .../aio/operations/__init__.py | 6 + .../core/access/aio/operations/_operations.py | 687 +++ .../aio/operations/_patch.py | 0 .../core/access/internaloperation/__init__.py | 1 - .../access/internaloperation/aio/__init__.py | 1 - .../aio/operations/__init__.py | 25 - .../aio/operations/_operations.py | 250 -- .../internaloperation/models/__init__.py | 27 - .../internaloperation/models/_models.py | 97 - .../internaloperation/operations/__init__.py | 25 - .../operations/_operations.py | 305 -- .../{publicoperation => }/models/__init__.py | 4 + .../models/_models.py | 174 +- .../{internaloperation => }/models/_patch.py | 0 .../operations/__init__.py | 6 + .../core/access/operations/_operations.py | 856 ++++ .../operations/_patch.py | 0 .../core/access/publicoperation/__init__.py | 1 - .../access/publicoperation/aio/__init__.py | 1 - .../aio/operations/__init__.py | 25 - .../aio/operations/_operations.py | 178 - .../access/publicoperation/models/_models.py | 69 - .../publicoperation/operations/__init__.py | 25 - .../publicoperation/operations/_operations.py | 218 - .../relativemodelinoperation/__init__.py | 1 - .../relativemodelinoperation/aio/__init__.py | 1 - .../aio/operations/_operations.py | 197 - .../models/__init__.py | 21 - .../operations/_operations.py | 237 - .../access/sharedmodelinoperation/__init__.py | 1 - .../sharedmodelinoperation/aio/__init__.py | 1 - .../aio/operations/__init__.py | 25 - .../aio/operations/_operations.py | 176 - .../sharedmodelinoperation/models/__init__.py | 27 - .../sharedmodelinoperation/models/_models.py | 41 - .../operations/__init__.py | 25 - .../operations/_operations.py | 216 - .../apiview-properties.json | 8 +- .../clientgenerator/core/usage/_client.py | 2 +- .../clientgenerator/core/usage/aio/_client.py | 2 +- .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 6 +- .../core/usage}/aio/operations/_patch.py | 0 .../core/usage/modelinoperation/__init__.py | 1 - .../usage/modelinoperation/aio/__init__.py | 1 - .../usage/modelinoperation/models/__init__.py | 33 - .../usage/modelinoperation/models/_models.py | 111 - .../core/usage/models/__init__.py | 8 + .../core/usage/models/_models.py | 100 +- .../operations/__init__.py | 0 .../operations/_operations.py | 6 +- .../core/usage/operations}/_patch.py | 0 .../core/basic/_operations/_operations.py | 2 +- .../core/basic/aio/_operations/_operations.py | 2 +- .../lro/standard/_operations/_operations.py | 2 +- .../standard/aio/_operations/_operations.py | 2 +- .../core/page/aio/operations/_operations.py | 10 +- .../azure/core/page/operations/_operations.py | 10 +- .../generated/azure-example-basic/MANIFEST.in | 5 +- .../generated/azure-example-basic/README.md | 6 +- .../apiview-properties.json | 4 +- .../azureexamplebasicclient/__init__.py | 32 - .../generated_samples/basic.py | 4 +- .../generated_tests/testpreparer.py | 2 +- .../generated_tests/testpreparer_async.py | 2 +- .../generated/azure-example-basic/setup.py | 12 +- .../specs/azure/example/basic/__init__.py | 33 +- .../azure/example/basic}/_client.py | 0 .../azure/example/basic}/_configuration.py | 2 +- .../azure/example/basic}/_model_base.py | 0 .../example/basic}/_operations/__init__.py | 0 .../example/basic}/_operations/_operations.py | 14 +- .../example/basic/_operations}/_patch.py | 0 .../specs/azure/example/basic}/_patch.py | 0 .../azure/example/basic}/_serialization.py | 0 .../azure/example/basic}/_vendor.py | 0 .../azure/example/basic}/_version.py | 0 .../azure/example/basic}/aio/__init__.py | 0 .../azure/example/basic}/aio/_client.py | 0 .../example/basic}/aio/_configuration.py | 2 +- .../basic}/aio/_operations/__init__.py | 0 .../basic}/aio/_operations/_operations.py | 14 +- .../example/basic/aio/_operations}/_patch.py | 0 .../specs/azure/example/basic/aio}/_patch.py | 0 .../azure/example/basic}/aio/_vendor.py | 0 .../azure/example/basic/models/_models.py | 10 +- .../azure/example/basic}/py.typed | 0 .../pageable/_operations/_operations.py | 2 +- .../pageable/aio/_operations/_operations.py | 2 +- .../aio/operations/_operations.py | 2 +- .../operations/_operations.py | 2 +- .../resources/aio/operations/_operations.py | 12 +- .../resources/operations/_operations.py | 12 +- .../lro/rpc/_operations/_operations.py | 2 +- .../lro/rpc/aio/_operations/_operations.py | 2 +- .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../second/_operations/_operations.py | 8 +- .../second/aio/_operations/_operations.py | 8 +- .../clientnamespace/second/models/_models.py | 6 +- .../client-naming/apiview-properties.json | 10 +- .../client-naming/client/naming/_client.py | 4 +- .../client/naming/aio/_client.py | 4 +- .../operations}/__init__.py | 4 + .../_operations.py | 347 +- .../client/naming}/aio/operations/_patch.py | 0 .../client/naming/model/__init__.py | 1 - .../client/naming/model/aio/__init__.py | 1 - .../naming/model/aio/operations/__init__.py | 25 - .../client/naming/model/models/__init__.py | 29 - .../client/naming/model/models/_models.py | 69 - .../naming/model/operations/__init__.py | 25 - .../naming/{property => }/models/__init__.py | 11 + .../naming/{unionenum => }/models/_enums.py | 0 .../naming/{property => }/models/_models.py | 60 +- .../client/naming}/models/_patch.py | 0 .../_operations => operations}/__init__.py | 4 + .../_operations.py | 403 +- .../client/naming}/operations/_patch.py | 0 .../client/naming/property/__init__.py | 1 - .../client/naming/unionenum/__init__.py | 1 - .../client/naming/unionenum/aio/__init__.py | 1 - .../unionenum/aio/operations/__init__.py | 25 - .../unionenum/aio/operations/_operations.py | 160 - .../naming/unionenum/models/__init__.py | 29 - .../naming/unionenum/operations/__init__.py | 25 - .../unionenum/operations/_operations.py | 189 - .../client/structure/service/_client.py | 4 +- .../client/structure/service/aio/_client.py | 4 +- .../service/aio/operations/__init__.py | 4 + .../service/aio/operations/_operations.py | 214 + .../client/structure/service/baz/__init__.py | 1 - .../structure/service/baz/aio/__init__.py | 1 - .../service/baz/aio/operations/__init__.py | 25 - .../service/baz/aio/operations/_operations.py | 116 - .../service/baz/operations/__init__.py | 25 - .../service/baz/operations/_operations.py | 125 - .../structure/service/operations/__init__.py | 4 + .../service/operations/_operations.py | 232 + .../client/structure/service/qux/__init__.py | 1 - .../structure/service/qux/aio/__init__.py | 1 - .../service/qux/aio/operations/__init__.py | 25 - .../service/qux/aio/operations/_operations.py | 161 - .../service/qux/operations/__init__.py | 25 - .../service/qux/operations/_operations.py | 177 - .../property/aio/operations/_operations.py | 66 +- .../bytes/property/operations/_operations.py | 66 +- .../property/aio/operations/_operations.py | 86 +- .../property/operations/_operations.py | 86 +- .../encode-duration/apiview-properties.json | 12 +- .../encode/duration/_client.py | 4 +- .../encode/duration/aio/_client.py | 4 +- .../duration}/aio/operations/__init__.py | 4 + .../aio/operations/_operations.py | 624 ++- .../encode/duration}/aio/operations/_patch.py | 0 .../encode/duration/header/__init__.py | 1 - .../encode/duration/header/aio/__init__.py | 1 - .../header/aio/operations/__init__.py | 25 - .../header/aio/operations/_operations.py | 341 -- .../duration/header/operations/__init__.py | 25 - .../duration/header/operations/_operations.py | 419 -- .../duration/header/operations/_patch.py | 20 - .../{property => }/models/__init__.py | 0 .../duration/{property => }/models/_models.py | 4 +- .../encode/duration}/models/_patch.py | 0 .../encode/duration}/operations/__init__.py | 4 + .../{property => }/operations/_operations.py | 796 +++- .../encode/duration}/operations/_patch.py | 0 .../encode/duration/property/__init__.py | 1 - .../encode/duration/property/aio/__init__.py | 1 - .../property/aio/operations/_patch.py | 20 - .../encode/duration/property/models/_patch.py | 20 - .../duration/property/operations/_patch.py | 20 - .../encode/duration/query/__init__.py | 1 - .../encode/duration/query/aio/__init__.py | 1 - .../duration/query/aio/operations/__init__.py | 25 - .../query/aio/operations/_operations.py | 341 -- .../duration/query/aio/operations/_patch.py | 20 - .../duration/query/operations/__init__.py | 25 - .../duration/query/operations/_operations.py | 415 -- .../duration/query/operations/_patch.py | 20 - .../encode-numeric/apiview-properties.json | 6 +- .../encode-numeric/encode/numeric/_client.py | 2 +- .../encode/numeric/aio/_client.py | 2 +- .../numeric}/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 6 +- .../encode/numeric/aio/operations}/_patch.py | 0 .../numeric/{property => }/models/__init__.py | 0 .../numeric/{property => }/models/_models.py | 4 +- .../encode/numeric/models}/_patch.py | 0 .../encode/numeric}/operations/__init__.py | 0 .../{property => }/operations/_operations.py | 6 +- .../encode/numeric/operations}/_patch.py | 0 .../encode/numeric/property/__init__.py | 1 - .../encode/numeric/property/aio/__init__.py | 1 - .../numeric/property/aio/operations/_patch.py | 20 - .../encode/numeric/property/models/_patch.py | 20 - .../numeric/property/operations/_patch.py | 20 - .../parameters-basic/apiview-properties.json | 2 +- .../parameters/basic/_client.py | 3 +- .../parameters/basic/aio/_client.py | 3 +- .../aio/operations/__init__.py | 2 + .../basic}/aio/operations/_operations.py | 94 +- .../basic/aio/operations}/_patch.py | 0 .../parameters/basic/explicitbody/__init__.py | 1 - .../basic/explicitbody/aio/__init__.py | 1 - .../aio/operations/_operations.py | 155 - .../explicitbody/aio/operations/_patch.py | 20 - .../basic/explicitbody/models/_patch.py | 20 - .../explicitbody/operations/_operations.py | 173 - .../basic/explicitbody/operations/_patch.py | 20 - .../parameters/basic/implicitbody/__init__.py | 1 - .../basic/implicitbody/aio/__init__.py | 1 - .../implicitbody/aio/operations/__init__.py | 25 - .../aio/operations/_operations.py | 162 - .../implicitbody/aio/operations/_patch.py | 20 - .../basic/implicitbody/operations/__init__.py | 25 - .../implicitbody/operations/_operations.py | 180 - .../basic/implicitbody/operations/_patch.py | 20 - .../{explicitbody => }/models/__init__.py | 0 .../{explicitbody => }/models/_models.py | 4 +- .../parameters/basic/models}/_patch.py | 0 .../{explicitbody => }/operations/__init__.py | 2 + .../basic}/operations/_operations.py | 106 +- .../parameters/basic/operations}/_patch.py | 0 .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../parameters-spread/apiview-properties.json | 2 +- .../parameters/spread/_client.py | 3 +- .../parameters/spread/aio/_client.py | 3 +- .../{alias => }/aio/operations/__init__.py | 2 + .../{alias => }/aio/operations/_operations.py | 559 ++- .../spread}/aio/operations/_patch.py | 0 .../parameters/spread/alias/__init__.py | 1 - .../parameters/spread/alias/aio/__init__.py | 1 - .../spread/alias/aio/operations/_patch.py | 20 - .../spread/alias/operations/_patch.py | 20 - .../parameters/spread/model/__init__.py | 1 - .../parameters/spread/model/aio/__init__.py | 1 - .../spread/model/aio/operations/__init__.py | 25 - .../model/aio/operations/_operations.py | 592 --- .../spread/model/aio/operations/_patch.py | 20 - .../parameters/spread/model/models/_patch.py | 20 - .../spread/model/operations/__init__.py | 25 - .../spread/model/operations/_operations.py | 679 --- .../spread/model/operations/_patch.py | 20 - .../spread/{model => }/models/__init__.py | 0 .../spread/{model => }/models/_models.py | 4 +- .../parameters/spread}/models/_patch.py | 0 .../spread/{alias => }/operations/__init__.py | 2 + .../{alias => }/operations/_operations.py | 657 ++- .../parameters/spread}/operations/_patch.py | 0 .../apiview-properties.json | 2 +- .../payload/contentnegotiation/_client.py | 3 +- .../payload/contentnegotiation/aio/_client.py | 3 +- .../aio/operations/__init__.py | 2 + .../aio/operations/_operations.py | 142 +- .../aio/operations}/_patch.py | 0 .../differentbody/__init__.py | 1 - .../differentbody/aio/__init__.py | 1 - .../differentbody/aio/operations/_patch.py | 20 - .../differentbody/models/_patch.py | 20 - .../differentbody/operations/_patch.py | 20 - .../{differentbody => }/models/__init__.py | 0 .../{differentbody => }/models/_models.py | 4 +- .../contentnegotiation/models}/_patch.py | 0 .../operations/__init__.py | 2 + .../operations/_operations.py | 166 +- .../contentnegotiation/operations}/_patch.py | 0 .../contentnegotiation/samebody/__init__.py | 1 - .../samebody/aio/__init__.py | 1 - .../samebody/aio/operations/__init__.py | 25 - .../samebody/aio/operations/_operations.py | 173 - .../samebody/aio/operations/_patch.py | 20 - .../samebody/operations/__init__.py | 25 - .../samebody/operations/_operations.py | 198 - .../samebody/operations/_patch.py | 20 - .../payload-multipart/apiview-properties.json | 2 +- .../payload/multipart/_client.py | 2 +- .../payload/multipart/aio/_client.py | 2 +- .../{formdata => }/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 468 +- .../multipart/aio}/operations/_patch.py | 0 .../payload/multipart/formdata/__init__.py | 1 - .../multipart/formdata/aio/__init__.py | 1 - .../formdata/aio/operations/_patch.py | 20 - .../multipart/formdata/httpparts/__init__.py | 1 - .../formdata/httpparts/aio/__init__.py | 1 - .../httpparts/aio/operations/__init__.py | 22 - .../httpparts/aio/operations/_operations.py | 140 - .../httpparts/aio/operations/_patch.py | 20 - .../httpparts/contenttype/__init__.py | 1 - .../httpparts/contenttype/aio/__init__.py | 1 - .../contenttype/aio/operations/__init__.py | 22 - .../contenttype/aio/operations/_operations.py | 298 -- .../contenttype/aio/operations/_patch.py | 20 - .../contenttype/operations/__init__.py | 22 - .../contenttype/operations/_operations.py | 324 -- .../contenttype/operations/_patch.py | 20 - .../formdata/httpparts/nonstring/__init__.py | 1 - .../httpparts/nonstring/aio/__init__.py | 1 - .../nonstring/aio/operations/__init__.py | 22 - .../nonstring/aio/operations/_operations.py | 130 - .../nonstring/aio/operations/_patch.py | 20 - .../httpparts/nonstring/models/__init__.py | 27 - .../httpparts/nonstring/models/_models.py | 41 - .../httpparts/nonstring/models/_patch.py | 20 - .../nonstring/operations/__init__.py | 22 - .../nonstring/operations/_operations.py | 144 - .../httpparts/nonstring/operations/_patch.py | 20 - .../formdata/httpparts/operations/__init__.py | 22 - .../httpparts/operations/_operations.py | 154 - .../formdata/httpparts/operations/_patch.py | 20 - .../multipart/formdata/operations/_patch.py | 20 - .../payload/multipart/models/__init__.py | 2 + .../payload/multipart/models/_models.py | 28 + .../{formdata => }/operations/__init__.py | 0 .../{formdata => }/operations/_operations.py | 512 ++- .../payload/multipart}/operations/_patch.py | 0 .../aio/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 214 +- .../operations/_operations.py | 214 +- .../operations/_operations.py | 8 +- .../apiview-properties.json | 2 +- .../serialization/encodedname/json/_client.py | 2 +- .../encodedname/json/aio/_client.py | 2 +- .../json}/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 6 +- .../json/aio}/operations/_patch.py | 0 .../json/{property => }/models/__init__.py | 0 .../json/{property => }/models/_models.py | 4 +- .../encodedname/json/models}/_patch.py | 0 .../encodedname/json}/operations/__init__.py | 0 .../{property => }/operations/_operations.py | 6 +- .../encodedname/json}/operations/_patch.py | 0 .../encodedname/json/property/__init__.py | 1 - .../encodedname/json/property/aio/__init__.py | 1 - .../json/property/aio/operations/_patch.py | 20 - .../json/property/models/_patch.py | 20 - .../json/property/operations/_patch.py | 20 - .../special-words/apiview-properties.json | 68 +- .../special-words/specialwords/_client.py | 4 +- .../special-words/specialwords/aio/_client.py | 4 +- .../specialwords/aio/operations/__init__.py | 4 + .../aio/operations/_operations.py | 3456 ++++++++++++++- .../specialwords/modelproperties/__init__.py | 1 - .../modelproperties/aio/__init__.py | 1 - .../aio/operations/__init__.py | 25 - .../aio/operations/_operations.py | 157 - .../modelproperties/aio/operations/_patch.py | 20 - .../modelproperties/models/__init__.py | 27 - .../modelproperties/models/_models.py | 41 - .../modelproperties/models/_patch.py | 20 - .../modelproperties/operations/__init__.py | 25 - .../modelproperties/operations/_operations.py | 175 - .../modelproperties/operations/_patch.py | 20 - .../specialwords/models/__init__.py | 94 +- .../models/{models => }/_models.py | 32 +- .../specialwords/models}/_patch.py | 0 .../specialwords/models/aio/__init__.py | 1 - .../models/aio/operations/__init__.py | 25 - .../models/aio/operations/_operations.py | 3370 -------------- .../models/aio/operations/_patch.py | 20 - .../specialwords/models/models/__init__.py | 91 - .../specialwords/models/models/_patch.py | 20 - .../models/operations/__init__.py | 25 - .../models/operations/_operations.py | 3828 ---------------- .../specialwords/models/operations/_patch.py | 20 - .../specialwords/operations/__init__.py | 4 + .../specialwords/operations/_operations.py | 3927 ++++++++++++++++- ...test_azure_arm_operationtemplates_async.py | 1 + .../test_azure_arm_operationtemplates.py | 1 + .../property/aio/operations/_operations.py | 66 +- .../bytes/property/operations/_operations.py | 66 +- .../property/aio/operations/_operations.py | 86 +- .../property/operations/_operations.py | 86 +- .../property/aio/operations/_operations.py | 98 +- .../property/operations/_operations.py | 98 +- .../property/aio/operations/_operations.py | 50 +- .../property/operations/_operations.py | 50 +- .../aio/operations/_operations.py | 6 +- .../explicitbody/operations/_operations.py | 6 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../model/aio/operations/_operations.py | 10 +- .../spread/model/operations/_operations.py | 10 +- .../aio/operations/_operations.py | 8 +- .../differentbody/operations/_operations.py | 8 +- .../formdata/aio/operations/_operations.py | 26 +- .../httpparts/aio/operations/_operations.py | 6 +- .../contenttype/aio/operations/_operations.py | 14 +- .../contenttype/operations/_operations.py | 14 +- .../nonstring/aio/operations/_operations.py | 6 +- .../nonstring/operations/_operations.py | 6 +- .../httpparts/operations/_operations.py | 6 +- .../formdata/operations/_operations.py | 26 +- .../aio/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 222 +- .../operations/_operations.py | 222 +- .../operations/_operations.py | 8 +- .../property/aio/operations/_operations.py | 12 +- .../json/property/operations/_operations.py | 12 +- .../aio/operations/_operations.py | 6 +- .../modelproperties/operations/_operations.py | 6 +- .../models/aio/operations/_operations.py | 134 +- .../models/operations/_operations.py | 134 +- 415 files changed, 16066 insertions(+), 19464 deletions(-) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{relativemodelinoperation => }/aio/operations/__init__.py (75%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{internaloperation => }/aio/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{publicoperation => }/models/__init__.py (90%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{relativemodelinoperation => }/models/_models.py (52%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{internaloperation => }/models/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{relativemodelinoperation => }/operations/__init__.py (75%) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/{internaloperation => }/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{modelinoperation => }/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{modelinoperation => }/aio/operations/_operations.py (98%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation => azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage}/aio/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{modelinoperation => }/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/{modelinoperation => }/operations/_operations.py (99%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models => azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_client.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_model_base.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_operations/_operations.py (94%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations => azure-example-basic/specs/azure/example/basic/_operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations => azure-example-basic/specs/azure/example/basic}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_serialization.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/_version.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/_client.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/_operations/_operations.py (93%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models => azure-example-basic/specs/azure/example/basic/aio/_operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations => azure-example-basic/specs/azure/example/basic/aio}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/aio/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/azure-example-basic/{azureexamplebasicclient => specs/azure/example/basic}/py.typed (100%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{_operations => aio/operations}/__init__.py (84%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/{_operations => operations}/_operations.py (59%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation => client-naming/client/naming}/aio/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{property => }/models/__init__.py (83%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{unionenum => }/models/_enums.py (100%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{property => }/models/_models.py (64%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation => client-naming/client/naming}/models/_patch.py (100%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{aio/_operations => operations}/__init__.py (84%) rename packages/typespec-python/test/azure/generated/client-naming/client/naming/{_operations => operations}/_operations.py (59%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation => client-naming/client/naming}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json/property => encode-duration/encode/duration}/aio/operations/__init__.py (85%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{property => }/aio/operations/_operations.py (59%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation => encode-duration/encode/duration}/aio/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{property => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{property => }/models/_models.py (98%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation => encode-duration/encode/duration}/models/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{serialization-encoded-name-json/serialization/encodedname/json/property => encode-duration/encode/duration}/operations/__init__.py (85%) rename packages/typespec-python/test/azure/generated/encode-duration/encode/duration/{property => }/operations/_operations.py (57%) rename packages/typespec-python/test/azure/generated/{azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation => encode-duration/encode/duration}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/property => encode-numeric/encode/numeric}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{property => }/aio/operations/_operations.py (99%) rename packages/typespec-python/test/azure/generated/{azure-example-basic/azureexamplebasicclient/_operations => encode-numeric/encode/numeric/aio/operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{property => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{property => }/models/_models.py (97%) rename packages/typespec-python/test/azure/generated/{azure-example-basic/azureexamplebasicclient => encode-numeric/encode/numeric/models}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/property => encode-numeric/encode/numeric}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/{property => }/operations/_operations.py (99%) rename packages/typespec-python/test/azure/generated/{azure-example-basic/azureexamplebasicclient/aio/_operations => encode-numeric/encode/numeric/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{explicitbody => }/aio/operations/__init__.py (90%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/model => parameters-basic/parameters/basic}/aio/operations/_operations.py (72%) rename packages/typespec-python/test/azure/generated/{azure-example-basic/azureexamplebasicclient/aio => parameters-basic/parameters/basic/aio/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{explicitbody => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{explicitbody => }/models/_models.py (94%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/_operations => parameters-basic/parameters/basic/models}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/{explicitbody => }/operations/__init__.py (90%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/model => parameters-basic/parameters/basic}/operations/_operations.py (72%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/aio/_operations => parameters-basic/parameters/basic/operations}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{alias => }/aio/operations/__init__.py (92%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{alias => }/aio/operations/_operations.py (57%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/model => parameters-spread/parameters/spread}/aio/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{model => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{model => }/models/_models.py (94%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/model => parameters-spread/parameters/spread}/models/_patch.py (100%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{alias => }/operations/__init__.py (92%) rename packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/{alias => }/operations/_operations.py (57%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/model => parameters-spread/parameters/spread}/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/aio/operations/__init__.py (91%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/aio/operations/_operations.py (55%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/property/models => payload-content-negotiation/payload/contentnegotiation/aio/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/models/_models.py (94%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/unionenum/aio/operations => payload-content-negotiation/payload/contentnegotiation/models}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/operations/__init__.py (91%) rename packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/{differentbody => }/operations/_operations.py (55%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/unionenum/models => payload-content-negotiation/payload/contentnegotiation/operations}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{formdata => }/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{formdata => }/aio/operations/_operations.py (55%) rename packages/typespec-python/test/azure/generated/{client-naming/client/naming/unionenum => payload-multipart/payload/multipart/aio}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{formdata => }/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/{formdata => }/operations/_operations.py (56%) rename packages/typespec-python/test/azure/generated/{client-structure-default/client/structure/service/baz/aio => payload-multipart/payload/multipart}/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric/property => serialization-encoded-name-json/serialization/encodedname/json}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{property => }/aio/operations/_operations.py (97%) rename packages/typespec-python/test/azure/generated/{client-structure-default/client/structure/service/baz => serialization-encoded-name-json/serialization/encodedname/json/aio}/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{property => }/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{property => }/models/_models.py (95%) rename packages/typespec-python/test/azure/generated/{client-structure-default/client/structure/service/qux/aio/operations => serialization-encoded-name-json/serialization/encodedname/json/models}/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{encode-numeric/encode/numeric/property => serialization-encoded-name-json/serialization/encodedname/json}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/{property => }/operations/_operations.py (98%) rename packages/typespec-python/test/azure/generated/{client-structure-default/client/structure/service/qux => serialization-encoded-name-json/serialization/encodedname/json}/operations/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py rename packages/typespec-python/test/azure/generated/special-words/specialwords/models/{models => }/_models.py (96%) rename packages/typespec-python/test/azure/generated/{encode-duration/encode/duration/header/aio/operations => special-words/specialwords/models}/_patch.py (100%) delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 3e3a564c491..b24dc26578b 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -45,48 +45,48 @@ "generator/**" ], "peerDependencies": { - "@typespec/compiler": ">=0.66.0 <1.0.0", - "@typespec/http": ">=0.66.0 <1.0.0", - "@typespec/rest": ">=0.66.0 <1.0.0", - "@typespec/versioning": ">=0.66.0 <1.0.0", - "@typespec/openapi": ">=0.66.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.52.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.52.0 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.52.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.52.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.52.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": "0.53.0-dev.23" + "@azure-tools/typespec-client-generator-core": "0.53.0-dev.23", + "@typespec/compiler": ">=0.66.0 <1.0.0", + "@typespec/http": ">=0.66.0 <1.0.0", + "@typespec/openapi": ">=0.66.0 <1.0.0", + "@typespec/rest": ">=0.66.0 <1.0.0", + "@typespec/versioning": ">=0.66.0 <1.0.0" }, "dependencies": { + "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", + "fs-extra": "~11.2.0", "js-yaml": "~4.1.0", - "semver": "~7.6.2", - "tsx": "~4.19.1", - "@typespec/http-client-python": "/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", - "fs-extra": "~11.2.0" + "semver": "~7.6.3", + "tsx": "~4.19.3" }, "devDependencies": { - "@typespec/compiler": "~0.66.0", - "@typespec/http": "~0.66.0", - "@typespec/rest": "~0.66.0", - "@typespec/versioning": "~0.66.0", - "@typespec/openapi": "~0.66.0", - "@azure-tools/typespec-azure-resource-manager": "~0.52.0", + "@azure-tools/azure-http-specs": "0.1.0-alpha.7", + "@azure-tools/typespec-autorest": "~0.52.0", "@azure-tools/typespec-azure-core": "~0.52.0", + "@azure-tools/typespec-azure-resource-manager": "~0.52.0", "@azure-tools/typespec-azure-rulesets": "~0.52.0", - "@azure-tools/typespec-autorest": "~0.52.0", "@azure-tools/typespec-client-generator-core": "0.53.0-dev.23", - "@azure-tools/azure-http-specs": "0.1.0-alpha.7", - "@typespec/http-specs": "0.1.0-alpha.11", - "@types/js-yaml": "~4.0.5", - "@types/node": "~22.5.4", - "@types/yargs": "~17.0.33", + "@types/fs-extra": "11.0.4", + "@types/js-yaml": "~4.0.9", + "@types/node": "~22.5.5", "@types/semver": "7.5.8", + "@types/yargs": "~17.0.33", + "@typespec/compiler": "~0.66.0", + "@typespec/http": "~0.66.0", + "@typespec/http-specs": "0.1.0-alpha.11", + "@typespec/openapi": "~0.66.0", + "@typespec/rest": "~0.66.0", + "@typespec/versioning": "~0.66.0", "c8": "^10.1.3", - "vitest": "^3.0.5", + "chalk": "5.3.0", "rimraf": "~6.0.1", "typescript": "~5.7.3", - "typescript-eslint": "^8.21.0", - "yargs": "~17.7.2", - "chalk": "5.3.0", - "@types/fs-extra": "11.0.4" + "typescript-eslint": "^8.26.1", + "vitest": "^3.0.8", + "yargs": "~17.7.2" } } diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 3240e99824f..90bf8ed44e5 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -19,6 +19,64 @@ interface TspCommand { command: string; } +const AZURE_EMITTER_OPTIONS: Record | Record[]> = { + "azure/example/basic": { + namespace: "specs.azure.example.basic", + }, + "azure/client-generator-core/access": { + namespace: "specs.azure.clientgenerator.core.access", + }, + "azure/client-generator-core/usage": { + namespace: "specs.azure.clientgenerator.core.usage", + }, + "azure/core/lro/rpc": { + "package-name": "azurecore-lro-rpc", + "namespace": "azurecore.lro.rpc", + }, + "client/structure/default": { + namespace: "client.structure.service", + }, + "client/structure/multi-client": { + "package-name": "client-structure-multiclient", + "namespace": "client.structure.multiclient", + }, + "client/structure/renamed-operation": { + "package-name": "client-structure-renamedoperation", + "namespace": "client.structure.renamedoperation", + }, + "client/structure/two-operation-group": { + "package-name": "client-structure-twooperationgroup", + "namespace": "client.structure.twooperationgroup", + }, + "client/naming": { + namespace: "client.naming", + }, + "encode/duration": { + namespace: "encode.duration", + }, + "encode/numeric": { + namespace: "encode.numeric", + }, + "parameters/basic": { + namespace: "parameters.basic", + }, + "parameters/spread": { + namespace: "parameters.spread", + }, + "payload/content-negotiation": { + namespace: "payload.contentnegotiation", + }, + "payload/multipart": { + namespace: "payload.multipart", + }, + "serialization/encoded-name/json": { + namespace: "serialization.encodedname.json", + }, + "special-words": { + namespace: "specialwords", + }, +}; + const EMITTER_OPTIONS: Record | Record[]> = { "resiliency/srv-driven/old.tsp": { "package-name": "resiliency-srv-driven1", @@ -153,7 +211,7 @@ function getEmitterOption(spec: string, flavor: string): Record[ const specDir = spec.includes("azure") ? AZURE_HTTP_SPECS : HTTP_SPECS; const relativeSpec = toPosix(relative(specDir, spec)); const key = relativeSpec.includes("resiliency/srv-driven/old.tsp") ? relativeSpec : dirname(relativeSpec); - const emitter_options = EMITTER_OPTIONS[key] || [{}]; + const emitter_options = EMITTER_OPTIONS[key] || (flavor === "azure" ? AZURE_EMITTER_OPTIONS[key] : [{}]) || [{}]; const result = Array.isArray(emitter_options) ? emitter_options : [emitter_options]; function updateOptions(options: Record): void { diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json index 3fd648f0ea7..00f5a031481 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/apiview-properties.json @@ -1,10 +1,10 @@ { "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Access", "CrossLanguageDefinitionId": { - "specs.azure.clientgenerator.core.access.publicoperation.models.NoDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.NoDecoratorModelInPublic", - "specs.azure.clientgenerator.core.access.internaloperation.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal", - "specs.azure.clientgenerator.core.access.publicoperation.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic", - "specs.azure.clientgenerator.core.access.sharedmodelinoperation.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel", + "specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.NoDecoratorModelInPublic", + "specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal", + "specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic", + "specs.azure.clientgenerator.core.access.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel", "specs.azure.clientgenerator.core.access.AccessClient.public_operation.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic", "specs.azure.clientgenerator.core.access.AccessClient.public_operation.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic", "specs.azure.clientgenerator.core.access.AccessClient.shared_model_in_operation.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py index 9a8405bc364..c90e9c86bd3 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_client.py @@ -16,10 +16,12 @@ from ._configuration import AccessClientConfiguration from ._serialization import Deserializer, Serializer -from .internaloperation.operations import InternalOperationOperations -from .publicoperation.operations import PublicOperationOperations -from .relativemodelinoperation.operations import RelativeModelInOperationOperations -from .sharedmodelinoperation.operations import SharedModelInOperationOperations +from .operations import ( + InternalOperationOperations, + PublicOperationOperations, + RelativeModelInOperationOperations, + SharedModelInOperationOperations, +) class AccessClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py index 0238bdf2f23..9c535497862 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/_client.py @@ -15,11 +15,13 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..internaloperation.aio.operations import InternalOperationOperations -from ..publicoperation.aio.operations import PublicOperationOperations -from ..relativemodelinoperation.aio.operations import RelativeModelInOperationOperations -from ..sharedmodelinoperation.aio.operations import SharedModelInOperationOperations from ._configuration import AccessClientConfiguration +from .operations import ( + InternalOperationOperations, + PublicOperationOperations, + RelativeModelInOperationOperations, + SharedModelInOperationOperations, +) class AccessClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py similarity index 75% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py index c0efa1f86ed..4d4e085659d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/__init__.py @@ -12,6 +12,9 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import PublicOperationOperations # type: ignore +from ._operations import InternalOperationOperations # type: ignore +from ._operations import SharedModelInOperationOperations # type: ignore from ._operations import RelativeModelInOperationOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +22,9 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "PublicOperationOperations", + "InternalOperationOperations", + "SharedModelInOperationOperations", "RelativeModelInOperationOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py new file mode 100644 index 00000000000..a60382927e5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py @@ -0,0 +1,687 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models as _models +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer +from ...operations._operations import ( + build_internal_operation_internal_decorator_in_internal_request, + build_internal_operation_no_decorator_in_internal_request, + build_internal_operation_public_decorator_in_internal_request, + build_public_operation_no_decorator_in_public_request, + build_public_operation_public_decorator_in_public_request, + build_relative_model_in_operation_discriminator_request, + build_relative_model_in_operation_operation_request, + build_shared_model_in_operation_internal_request, + build_shared_model_in_operation_public_request, +) +from .._configuration import AccessClientConfiguration + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PublicOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`public_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: + """no_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_no_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: + """public_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_public_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InternalOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`internal_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def _no_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.NoDecoratorModelInInternal: + """no_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_no_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _internal_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.InternalDecoratorModelInInternal: + """internal_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible + with MutableMapping + :rtype: + ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_internal_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _public_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models.PublicDecoratorModelInInternal: + """public_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_public_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SharedModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`shared_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """public. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """internal. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RelativeModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s + :attr:`relative_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: + """Expected query parameter: name="Madge" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "inner": + { + "name": "Madge" + } + }. + + :keyword name: Required. + :paramtype name: str + :return: OuterModel. The OuterModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_operation_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: + """Expected query parameter: kind="real" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "kind": "real" + }. + + :keyword kind: Required. + :paramtype kind: str + :return: AbstractModel. The AbstractModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_discriminator_request( + kind=kind, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.AbstractModel, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py deleted file mode 100644 index 05a427c34aa..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import InternalOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "InternalOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py deleted file mode 100644 index c0355ec5a7c..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/aio/operations/_operations.py +++ /dev/null @@ -1,250 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ...._model_base import _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import AccessClientConfiguration -from ...operations._operations import ( - build_internal_operation_internal_decorator_in_internal_request, - build_internal_operation_no_decorator_in_internal_request, - build_internal_operation_public_decorator_in_internal_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class InternalOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`internal_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def _no_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.NoDecoratorModelInInternal: - """no_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_no_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _internal_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.InternalDecoratorModelInInternal: - """internal_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible - with MutableMapping - :rtype: - ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_internal_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _public_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models.PublicDecoratorModelInInternal: - """public_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_public_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py deleted file mode 100644 index 74869987f06..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - PublicDecoratorModelInInternal, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "PublicDecoratorModelInInternal", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py deleted file mode 100644 index ea6b70f3bc0..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_models.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ... import _model_base -from ..._model_base import rest_field - - -class InternalDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation, should be generated but not exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NoDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation, should be generated but not exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PublicDecoratorModelInInternal(_model_base.Model): - """Used in an internal operation but with public decorator, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py deleted file mode 100644 index 05a427c34aa..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import InternalOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "InternalOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py deleted file mode 100644 index 9b59e8b9398..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_operations.py +++ /dev/null @@ -1,305 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import AccessClientConfiguration -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_internal_operation_no_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/noDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_internal_operation_internal_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_internal_operation_public_decorator_in_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class InternalOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`internal_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def _no_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models._models.NoDecoratorModelInInternal: - """no_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_no_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _internal_decorator_in_internal( - self, *, name: str, **kwargs: Any - ) -> _models._models.InternalDecoratorModelInInternal: - """internal_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible - with MutableMapping - :rtype: - ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_internal_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _public_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInInternal: - """public_decorator_in_internal. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) - - _request = build_internal_operation_public_decorator_in_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py index 783a5b8e283..19e5aaae4b4 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/__init__.py @@ -15,7 +15,9 @@ from ._models import ( # type: ignore NoDecoratorModelInPublic, + PublicDecoratorModelInInternal, PublicDecoratorModelInPublic, + SharedModel, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -23,7 +25,9 @@ __all__ = [ "NoDecoratorModelInPublic", + "PublicDecoratorModelInInternal", "PublicDecoratorModelInPublic", + "SharedModel", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py similarity index 52% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py index b34ddb55b49..73740de086a 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py @@ -8,10 +8,10 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Dict, Literal, TYPE_CHECKING +from typing import Any, Dict, Literal, Mapping, TYPE_CHECKING, overload -from ... import _model_base -from ..._model_base import rest_discriminator, rest_field +from .. import _model_base +from .._model_base import rest_discriminator, rest_field if TYPE_CHECKING: from .. import models as _models @@ -110,6 +110,90 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class InternalDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation, should be generated but not exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NoDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation, should be generated but not exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NoDecoratorModelInPublic(_model_base.Model): + """Used in a public operation, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class OuterModel(BaseModel): """Used in internal operations, should be generated but not exported. @@ -141,6 +225,62 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class PublicDecoratorModelInInternal(_model_base.Model): + """Used in an internal operation but with public decorator, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PublicDecoratorModelInPublic(_model_base.Model): + """Used in a public operation, should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class RealModel(AbstractModel, discriminator="real"): """Used in internal operations, should be generated but not exported. @@ -169,3 +309,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="real", **kwargs) + + +class SharedModel(_model_base.Model): + """Used by both public and internal operation. It should be generated and exported. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py similarity index 75% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py index c0efa1f86ed..4d4e085659d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/__init__.py @@ -12,6 +12,9 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import PublicOperationOperations # type: ignore +from ._operations import InternalOperationOperations # type: ignore +from ._operations import SharedModelInOperationOperations # type: ignore from ._operations import RelativeModelInOperationOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +22,9 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "PublicOperationOperations", + "InternalOperationOperations", + "SharedModelInOperationOperations", "RelativeModelInOperationOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py new file mode 100644 index 00000000000..9268632a40e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py @@ -0,0 +1,856 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from .._configuration import AccessClientConfiguration +from .._model_base import _deserialize +from .._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_public_operation_no_decorator_in_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/publicOperation/noDecoratorInPublic" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_public_operation_public_decorator_in_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internal_operation_no_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/noDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internal_operation_internal_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/internalDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internal_operation_public_decorator_in_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/internalOperation/publicDecoratorInInternal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_shared_model_in_operation_public_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/sharedModelInOperation/public" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_shared_model_in_operation_internal_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/sharedModelInOperation/internal" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_relative_model_in_operation_operation_request( # pylint: disable=name-too-long + *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/relativeModelInOperation/operation" + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_relative_model_in_operation_discriminator_request( # pylint: disable=name-too-long + *, kind: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/client-generator-core/access/relativeModelInOperation/discriminator" + + # Construct parameters + _params["kind"] = _SERIALIZER.query("kind", kind, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class PublicOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`public_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: + """no_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_no_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: + """public_decorator_in_public. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) + + _request = build_public_operation_public_decorator_in_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InternalOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`internal_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def _no_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models._models.NoDecoratorModelInInternal: + """no_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: NoDecoratorModelInInternal. The NoDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.NoDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NoDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_no_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.NoDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _internal_decorator_in_internal( + self, *, name: str, **kwargs: Any + ) -> _models._models.InternalDecoratorModelInInternal: + """internal_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: InternalDecoratorModelInInternal. The InternalDecoratorModelInInternal is compatible + with MutableMapping + :rtype: + ~specs.azure.clientgenerator.core.access.models._models.InternalDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.InternalDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_internal_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.InternalDecoratorModelInInternal, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _public_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInInternal: + """public_decorator_in_internal. + + :keyword name: Required. + :paramtype name: str + :return: PublicDecoratorModelInInternal. The PublicDecoratorModelInInternal is compatible with + MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PublicDecoratorModelInInternal] = kwargs.pop("cls", None) + + _request = build_internal_operation_public_decorator_in_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PublicDecoratorModelInInternal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SharedModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`shared_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """public. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_public_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: + """internal. + + :keyword name: Required. + :paramtype name: str + :return: SharedModel. The SharedModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) + + _request = build_shared_model_in_operation_internal_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SharedModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RelativeModelInOperationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s + :attr:`relative_model_in_operation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: + """Expected query parameter: name="Madge" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "inner": + { + "name": "Madge" + } + }. + + :keyword name: Required. + :paramtype name: str + :return: OuterModel. The OuterModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_operation_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: + """Expected query parameter: kind="real" + Expected response body: + + .. code-block:: json + + { + "name": "Madge", + "kind": "real" + }. + + :keyword kind: Required. + :paramtype kind: str + :return: AbstractModel. The AbstractModel is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) + + _request = build_relative_model_in_operation_discriminator_request( + kind=kind, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize( + _models._models.AbstractModel, response.json() # pylint: disable=protected-access + ) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/internaloperation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py deleted file mode 100644 index 43140bc8fe1..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import PublicOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "PublicOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py deleted file mode 100644 index b420cd126a1..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ...._model_base import _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import AccessClientConfiguration -from ...operations._operations import ( - build_public_operation_no_decorator_in_public_request, - build_public_operation_public_decorator_in_public_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PublicOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`public_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: - """no_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_no_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: - """public_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_public_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py deleted file mode 100644 index fbe465d21cb..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_models.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ... import _model_base -from ..._model_base import rest_field - - -class NoDecoratorModelInPublic(_model_base.Model): - """Used in a public operation, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PublicDecoratorModelInPublic(_model_base.Model): - """Used in a public operation, should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py deleted file mode 100644 index 43140bc8fe1..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import PublicOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "PublicOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py deleted file mode 100644 index e1ef42fe680..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_operations.py +++ /dev/null @@ -1,218 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import AccessClientConfiguration -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_public_operation_no_decorator_in_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/publicOperation/noDecoratorInPublic" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_public_operation_public_decorator_in_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/publicOperation/publicDecoratorInPublic" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PublicOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`public_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecoratorModelInPublic: - """no_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: NoDecoratorModelInPublic. The NoDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NoDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_no_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.NoDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.PublicDecoratorModelInPublic: - """public_decorator_in_public. - - :keyword name: Required. - :paramtype name: str - :return: PublicDecoratorModelInPublic. The PublicDecoratorModelInPublic is compatible with - MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PublicDecoratorModelInPublic] = kwargs.pop("cls", None) - - _request = build_public_operation_public_decorator_in_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PublicDecoratorModelInPublic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py deleted file mode 100644 index 2b7b7545e49..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_operations.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ...._model_base import _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import AccessClientConfiguration -from ...operations._operations import ( - build_relative_model_in_operation_discriminator_request, - build_relative_model_in_operation_operation_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class RelativeModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`relative_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "inner": - { - "name": "Madge" - } - }. - - :keyword name: Required. - :paramtype name: str - :return: OuterModel. The OuterModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_operation_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "kind": "real" - }. - - :keyword kind: Required. - :paramtype kind: str - :return: AbstractModel. The AbstractModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_discriminator_request( - kind=kind, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.AbstractModel, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py deleted file mode 100644 index e3b4c5295f0..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py deleted file mode 100644 index 87509cc2925..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_operations.py +++ /dev/null @@ -1,237 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import AccessClientConfiguration -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_relative_model_in_operation_operation_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/relativeModelInOperation/operation" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_relative_model_in_operation_discriminator_request( # pylint: disable=name-too-long - *, kind: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/relativeModelInOperation/discriminator" - - # Construct parameters - _params["kind"] = _SERIALIZER.query("kind", kind, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RelativeModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`relative_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: - """Expected query parameter: name="Madge" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "inner": - { - "name": "Madge" - } - }. - - :keyword name: Required. - :paramtype name: str - :return: OuterModel. The OuterModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.OuterModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.OuterModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_operation_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models._models.OuterModel, response.json()) # pylint: disable=protected-access - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _discriminator(self, *, kind: str, **kwargs: Any) -> _models._models.AbstractModel: - """Expected query parameter: kind="real" - Expected response body: - - .. code-block:: json - - { - "name": "Madge", - "kind": "real" - }. - - :keyword kind: Required. - :paramtype kind: str - :return: AbstractModel. The AbstractModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models._models.AbstractModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models._models.AbstractModel] = kwargs.pop("cls", None) - - _request = build_relative_model_in_operation_discriminator_request( - kind=kind, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize( - _models._models.AbstractModel, response.json() # pylint: disable=protected-access - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py deleted file mode 100644 index bf96eabc126..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import SharedModelInOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SharedModelInOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py deleted file mode 100644 index c26424be3e5..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ...._model_base import _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import AccessClientConfiguration -from ...operations._operations import ( - build_shared_model_in_operation_internal_request, - build_shared_model_in_operation_public_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SharedModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.aio.AccessClient`'s - :attr:`shared_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """public. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """internal. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py deleted file mode 100644 index 2e391133ec0..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - SharedModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SharedModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py deleted file mode 100644 index a6b27018ff0..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_models.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ... import _model_base -from ..._model_base import rest_field - - -class SharedModel(_model_base.Model): - """Used by both public and internal operation. It should be generated and exported. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py deleted file mode 100644 index bf96eabc126..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import SharedModelInOperationOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SharedModelInOperationOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py deleted file mode 100644 index 35123fea702..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_operations.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import AccessClientConfiguration -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_shared_model_in_operation_public_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/sharedModelInOperation/public" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_shared_model_in_operation_internal_request( # pylint: disable=name-too-long - *, name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/azure/client-generator-core/access/sharedModelInOperation/internal" - - # Construct parameters - _params["name"] = _SERIALIZER.query("name", name, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SharedModelInOperationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specs.azure.clientgenerator.core.access.AccessClient`'s - :attr:`shared_model_in_operation` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AccessClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """public. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_public_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: - """internal. - - :keyword name: Required. - :paramtype name: str - :return: SharedModel. The SharedModel is compatible with MutableMapping - :rtype: ~specs.azure.clientgenerator.core.access.models.SharedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SharedModel] = kwargs.pop("cls", None) - - _request = build_shared_model_in_operation_internal_request( - name=name, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.SharedModel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json index 0604ce8f7b0..6b76d573f63 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/apiview-properties.json @@ -1,11 +1,11 @@ { "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Usage", "CrossLanguageDefinitionId": { - "specs.azure.clientgenerator.core.usage.modelinoperation.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel", + "specs.azure.clientgenerator.core.usage.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel", "specs.azure.clientgenerator.core.usage.models.OrphanModel": "_Specs_.Azure.ClientGenerator.Core.Usage.OrphanModel", - "specs.azure.clientgenerator.core.usage.modelinoperation.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel", - "specs.azure.clientgenerator.core.usage.modelinoperation.models.ResultModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.ResultModel", - "specs.azure.clientgenerator.core.usage.modelinoperation.models.RoundTripModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.RoundTripModel", + "specs.azure.clientgenerator.core.usage.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel", + "specs.azure.clientgenerator.core.usage.models.ResultModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.ResultModel", + "specs.azure.clientgenerator.core.usage.models.RoundTripModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.RoundTripModel", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.input_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.inputToInputOutput", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.output_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.outputToInputOutput", "specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.model_in_read_only_property": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.modelInReadOnlyProperty" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py index ffacdd6748c..b5460b7910d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/_client.py @@ -16,7 +16,7 @@ from ._configuration import UsageClientConfiguration from ._serialization import Deserializer, Serializer -from .modelinoperation.operations import ModelInOperationOperations +from .operations import ModelInOperationOperations class UsageClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py index b59d96bdec6..6df99c466f6 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..modelinoperation.aio.operations import ModelInOperationOperations from ._configuration import UsageClientConfiguration +from .operations import ModelInOperationOperations class UsageClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py index 173981c0e4b..cc2a46337ce 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py @@ -27,14 +27,14 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import SdkJSONEncoder, _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import UsageClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_model_in_operation_input_to_input_output_request, build_model_in_operation_model_in_read_only_property_request, build_model_in_operation_output_to_input_output_request, ) +from .._configuration import UsageClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py deleted file mode 100644 index f4a6043ca66..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - InputModel, - OutputModel, - ResultModel, - RoundTripModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "InputModel", - "OutputModel", - "ResultModel", - "RoundTripModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py deleted file mode 100644 index 70e191dad6c..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_models.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, TYPE_CHECKING, overload - -from ... import _model_base -from ..._model_base import rest_field - -if TYPE_CHECKING: - from .. import models as _models - - -class InputModel(_model_base.Model): - """Usage override to roundtrip. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OutputModel(_model_base.Model): - """Usage override to roundtrip. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ResultModel(_model_base.Model): - """ResultModel. - - :ivar name: Required. - :vartype name: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class RoundTripModel(_model_base.Model): - """RoundTripModel. - - :ivar result: Required. - :vartype result: ~specs.azure.clientgenerator.core.usage.models.ResultModel - """ - - result: "_models.ResultModel" = rest_field(visibility=["read"]) - """Required.""" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py index 4fd94e2f8f4..e5ed72eb8fc 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/__init__.py @@ -14,14 +14,22 @@ from ._models import ( # type: ignore + InputModel, OrphanModel, + OutputModel, + ResultModel, + RoundTripModel, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "InputModel", "OrphanModel", + "OutputModel", + "ResultModel", + "RoundTripModel", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py index ba0d99b7771..cbc58bcb8c7 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/models/_models.py @@ -7,11 +7,42 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Any, Mapping, overload +from typing import Any, Mapping, TYPE_CHECKING, overload from .. import _model_base from .._model_base import rest_field +if TYPE_CHECKING: + from .. import models as _models + + +class InputModel(_model_base.Model): + """Usage override to roundtrip. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + class OrphanModel(_model_base.Model): """Not used anywhere, but access is override to public so still need to be generated and exported @@ -40,3 +71,70 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + + +class OutputModel(_model_base.Model): + """Usage override to roundtrip. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResultModel(_model_base.Model): + """ResultModel. + + :ivar name: Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoundTripModel(_model_base.Model): + """RoundTripModel. + + :ivar result: Required. + :vartype result: ~specs.azure.clientgenerator.core.usage.models.ResultModel + """ + + result: "_models.ResultModel" = rest_field(visibility=["read"]) + """Required.""" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py index e1b990cf6ac..1beec9b9fd7 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import UsageClientConfiguration -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from .._configuration import UsageClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py index d8a7a613f85..28fd837cb2d 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py @@ -662,7 +662,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py index 58509381250..8142baeff57 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py @@ -483,7 +483,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py index 556c0e50997..46281ebcfa9 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py @@ -505,7 +505,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.ExportedUser, response.json().get("result")) + deserialized = _deserialize(_models.ExportedUser, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py index c8aa743ff4a..d4b2420ffa8 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py @@ -437,7 +437,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.ExportedUser, response.json().get("result")) + deserialized = _deserialize(_models.ExportedUser, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py index 1cf11641ddd..8e6733fd50a 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py @@ -127,7 +127,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.FirstItem], deserialized["value"]) + list_of_elem = _deserialize(List[_models.FirstItem], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -210,7 +210,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SecondItem], deserialized["value"]) + list_of_elem = _deserialize(List[_models.SecondItem], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -295,7 +295,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -471,7 +471,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -553,7 +553,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["items"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("items", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py index f7cd716eed7..c31207bd525 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py @@ -228,7 +228,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.FirstItem], deserialized["value"]) + list_of_elem = _deserialize(List[_models.FirstItem], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -311,7 +311,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SecondItem], deserialized["value"]) + list_of_elem = _deserialize(List[_models.SecondItem], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -396,7 +396,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -572,7 +572,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -654,7 +654,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["items"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("items", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in index ac8cfc63b5e..e0a4f8f51dd 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/MANIFEST.in @@ -1,5 +1,8 @@ include *.md include LICENSE -include azureexamplebasicclient/py.typed +include specs/azure/example/basic/py.typed recursive-include tests *.py recursive-include samples *.py *.md +include specs/__init__.py +include specs/azure/__init__.py +include specs/azure/example/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/README.md b/packages/typespec-python/test/azure/generated/azure-example-basic/README.md index d7888f59848..b3b60b80069 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/README.md +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/README.md @@ -1,4 +1,4 @@ -# Azureexamplebasicclient client library for Python +# Specs Azure Example Basic client library for Python ## Getting started @@ -6,14 +6,14 @@ ### Install the package ```bash -python -m pip install azureexamplebasicclient +python -m pip install specs-azure-example-basic ``` #### Prequisites - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- An existing Azureexamplebasicclient instance. +- An existing Specs Azure Example Basic instance. ## Contributing diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json index 3ef9cf51b96..c2aa7467184 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/apiview-properties.json @@ -4,7 +4,7 @@ "specs.azure.example.basic.models.ActionRequest": "_Specs_.Azure.Example.Basic.ActionRequest", "specs.azure.example.basic.models.ActionResponse": "_Specs_.Azure.Example.Basic.ActionResponse", "specs.azure.example.basic.models.Model": "_Specs_.Azure.Example.Basic.Model", - "azureexamplebasicclient.models.EnumEnum": "_Specs_.Azure.Example.Basic.Enum", - "azureexamplebasicclient.AzureExampleClient.basic_action": "AzureExampleBasicClient.AzureExampleClient.basicAction" + "specs.azure.example.basic.models.EnumEnum": "_Specs_.Azure.Example.Basic.Enum", + "specs.azure.example.basic.AzureExampleClient.basic_action": "AzureExampleBasicClient.AzureExampleClient.basicAction" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py deleted file mode 100644 index 508179d9aff..00000000000 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import AzureExampleClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AzureExampleClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py index 1c8a9539164..8fc73742343 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_samples/basic.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azureexamplebasicclient import AzureExampleClient +from specs.azure.example.basic import AzureExampleClient """ # PREREQUISITES - pip install azureexamplebasicclient + pip install specs-azure-example-basic # USAGE python basic.py """ diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py index d56991c5c24..6039e937d65 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer.py @@ -5,9 +5,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azureexamplebasicclient import AzureExampleClient from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer import functools +from specs.azure.example.basic import AzureExampleClient class AzureExampleClientTestBase(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py index 2308707d85b..64243921636 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/generated_tests/testpreparer_async.py @@ -5,8 +5,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azureexamplebasicclient.aio import AzureExampleClient from devtools_testutils import AzureRecordedTestCase +from specs.azure.example.basic.aio import AzureExampleClient class AzureExampleClientTestBaseAsync(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py index d1bac43338d..4180b71dd5c 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py @@ -12,9 +12,9 @@ from setuptools import setup, find_packages -PACKAGE_NAME = "azureexamplebasicclient" -PACKAGE_NAMESPACE = "azureexamplebasicclient" -PACKAGE_PPRINT_NAME = "Azureexamplebasicclient" +PACKAGE_NAME = "specs-azure-example-basic" +PACKAGE_NAMESPACE = "specs.azure.example.basic" +PACKAGE_PPRINT_NAME = "Specs Azure Example Basic" # a.b.c => a/b/c package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") @@ -52,11 +52,15 @@ packages=find_packages( exclude=[ "tests", + # Exclude packages that will be covered by PEP420 or nspkg + "specs", + "specs.azure", + "specs.azure.example", ] ), include_package_data=True, package_data={ - "azureexamplebasicclient": ["py.typed"], + "specs.azure.example.basic": ["py.typed"], }, install_requires=[ "isodate>=0.6.1", diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py index d55ccad1f57..508179d9aff 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/__init__.py @@ -1 +1,32 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AzureExampleClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AzureExampleClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_client.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_client.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py index 47c7e8fe831..14df3fdec52 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "azureexamplebasicclient/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-example-basic/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_model_base.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_model_base.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_model_base.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_model_base.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py index f42785623dc..0e8f98efa24 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_operations.py @@ -25,7 +25,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ...specs.azure.example.basic import models as _models +from .. import models as _models from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Serializer from .._vendor import AzureExampleClientMixinABC @@ -81,7 +81,7 @@ def basic_action( """basic_action. :param body: Required. - :type body: ~azureexamplebasicclient.models.ActionRequest + :type body: ~specs.azure.example.basic.models.ActionRequest :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. @@ -90,7 +90,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -110,7 +110,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -136,7 +136,7 @@ def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -147,13 +147,13 @@ def basic_action( """basic_action. :param body: Is one of the following types: ActionRequest, JSON, IO[bytes] Required. - :type body: ~azureexamplebasicclient.models.ActionRequest or JSON or IO[bytes] + :type body: ~specs.azure.example.basic.models.ActionRequest or JSON or IO[bytes] :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. :paramtype header_param: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/publicoperation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_serialization.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_serialization.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_serialization.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_serialization.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_vendor.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_version.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_version.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_version.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/_version.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_client.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py index 6b119b8c22a..b851be5e7f1 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "azureexamplebasicclient/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-example-basic/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py similarity index 93% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py index ac4b7f8501b..475464cd1bb 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ....specs.azure.example.basic import models as _models +from ... import models as _models from ..._model_base import SdkJSONEncoder, _deserialize from ..._operations._operations import build_azure_example_basic_action_request from .._vendor import AzureExampleClientMixinABC @@ -55,7 +55,7 @@ async def basic_action( """basic_action. :param body: Required. - :type body: ~azureexamplebasicclient.models.ActionRequest + :type body: ~specs.azure.example.basic.models.ActionRequest :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. @@ -64,7 +64,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -84,7 +84,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -110,7 +110,7 @@ async def basic_action( Default value is "application/json". :paramtype content_type: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -121,13 +121,13 @@ async def basic_action( """basic_action. :param body: Is one of the following types: ActionRequest, JSON, IO[bytes] Required. - :type body: ~azureexamplebasicclient.models.ActionRequest or JSON or IO[bytes] + :type body: ~specs.azure.example.basic.models.ActionRequest or JSON or IO[bytes] :keyword query_param: Required. :paramtype query_param: str :keyword header_param: Required. :paramtype header_param: str :return: ActionResponse. The ActionResponse is compatible with MutableMapping - :rtype: ~azureexamplebasicclient.models.ActionResponse + :rtype: ~specs.azure.example.basic.models.ActionResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/relativemodelinoperation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_vendor.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/aio/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py index cf815435ecb..37203ba9955 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload -from ......azureexamplebasicclient import _model_base -from ......azureexamplebasicclient._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field if TYPE_CHECKING: from .. import models as _models @@ -22,7 +22,7 @@ class ActionRequest(_model_base.Model): :ivar string_property: Required. :vartype string_property: str :ivar model_property: - :vartype model_property: ~azureexamplebasicclient.models.Model + :vartype model_property: ~specs.azure.example.basic.models.Model :ivar array_property: :vartype array_property: list[str] :ivar record_property: @@ -68,7 +68,7 @@ class ActionResponse(_model_base.Model): :ivar string_property: Required. :vartype string_property: str :ivar model_property: - :vartype model_property: ~azureexamplebasicclient.models.Model + :vartype model_property: ~specs.azure.example.basic.models.Model :ivar array_property: :vartype array_property: list[str] :ivar record_property: @@ -116,7 +116,7 @@ class Model(_model_base.Model): :ivar float32_property: :vartype float32_property: float :ivar enum_property: "EnumValue1" - :vartype enum_property: str or ~azureexamplebasicclient.models.EnumEnum + :vartype enum_property: str or ~specs.azure.example.basic.models.EnumEnum """ int32_property: Optional[int] = rest_field( diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/py.typed b/packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/py.typed similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/py.typed rename to packages/typespec-python/test/azure/generated/azure-example-basic/specs/azure/example/basic/py.typed diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py index a6148cb40a6..f2066a63a3a 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py @@ -113,7 +113,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py index d179d6d1030..eb6b8a225fd 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py @@ -91,7 +91,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.User], deserialized["value"]) + list_of_elem = _deserialize(List[_models.User], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py index a7637de197b..d93d71dc040 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py @@ -133,7 +133,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py index 9099f98d04e..124f552c529 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py @@ -295,7 +295,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py index ff9398adc0c..23941e40e61 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py @@ -816,7 +816,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -901,7 +901,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1872,7 +1872,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.NestedProxyResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.NestedProxyResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2405,7 +2405,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3030,7 +3030,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ExtensionsResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.ExtensionsResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3578,7 +3578,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.LocationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.LocationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py index 8db5995f08a..5932659b7c6 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py @@ -1575,7 +1575,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1660,7 +1660,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.TopLevelTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2631,7 +2631,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.NestedProxyResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.NestedProxyResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3164,7 +3164,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3791,7 +3791,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ExtensionsResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.ExtensionsResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4340,7 +4340,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.LocationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.LocationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py index 3e5947e21f7..3e3fd504125 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py @@ -224,7 +224,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.GenerationResult, response.json().get("result")) + deserialized = _deserialize(_models.GenerationResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py index 09ef88fc3ad..0dfcbc34b98 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py @@ -200,7 +200,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.GenerationResult, response.json().get("result")) + deserialized = _deserialize(_models.GenerationResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py index 6e14a00961a..0f337afcc7c 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/_operations/_operations.py @@ -26,7 +26,7 @@ from .._model_base import _deserialize from .._serialization import Serializer from .._vendor import ClientNamespaceFirstClientMixinABC -from ..first import models as _models +from ..first import models as _first_models2 if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -56,7 +56,7 @@ def build_client_namespace_first_get_first_request(**kwargs: Any) -> HttpRequest class ClientNamespaceFirstClientOperationsMixin(ClientNamespaceFirstClientMixinABC): # pylint: disable=name-too-long @distributed_trace - def get_first(self, **kwargs: Any) -> _models.FirstClientResult: + def get_first(self, **kwargs: Any) -> _first_models2.FirstClientResult: """get_first. :return: FirstClientResult. The FirstClientResult is compatible with MutableMapping @@ -74,7 +74,7 @@ def get_first(self, **kwargs: Any) -> _models.FirstClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.FirstClientResult] = kwargs.pop("cls", None) + cls: ClsType[_first_models2.FirstClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_first_get_first_request( headers=_headers, @@ -104,7 +104,7 @@ def get_first(self, **kwargs: Any) -> _models.FirstClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FirstClientResult, response.json()) + deserialized = _deserialize(_first_models2.FirstClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py index 9b4344934d5..daeb3184681 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/aio/_operations/_operations.py @@ -25,7 +25,7 @@ from ..._model_base import _deserialize from ..._operations._operations import build_client_namespace_first_get_first_request -from ...first import models as _models +from ...first import models as _first_models3 from .._vendor import ClientNamespaceFirstClientMixinABC if sys.version_info >= (3, 9): @@ -39,7 +39,7 @@ class ClientNamespaceFirstClientOperationsMixin(ClientNamespaceFirstClientMixinABC): # pylint: disable=name-too-long @distributed_trace_async - async def get_first(self, **kwargs: Any) -> _models.FirstClientResult: + async def get_first(self, **kwargs: Any) -> _first_models3.FirstClientResult: """get_first. :return: FirstClientResult. The FirstClientResult is compatible with MutableMapping @@ -57,7 +57,7 @@ async def get_first(self, **kwargs: Any) -> _models.FirstClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.FirstClientResult] = kwargs.pop("cls", None) + cls: ClsType[_first_models3.FirstClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_first_get_first_request( headers=_headers, @@ -87,7 +87,7 @@ async def get_first(self, **kwargs: Any) -> _models.FirstClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FirstClientResult, response.json()) + deserialized = _deserialize(_first_models3.FirstClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py index 02360c2b1d1..c8e0068ad3e 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/_operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._model_base import _deserialize from ..._serialization import Serializer from .._vendor import ClientNamespaceSecondClientMixinABC @@ -56,7 +56,7 @@ def build_client_namespace_second_get_second_request(**kwargs: Any) -> HttpReque class ClientNamespaceSecondClientOperationsMixin(ClientNamespaceSecondClientMixinABC): # pylint: disable=name-too-long @distributed_trace - def get_second(self, **kwargs: Any) -> _models.SecondClientResult: + def get_second(self, **kwargs: Any) -> _models1.SecondClientResult: """get_second. :return: SecondClientResult. The SecondClientResult is compatible with MutableMapping @@ -74,7 +74,7 @@ def get_second(self, **kwargs: Any) -> _models.SecondClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SecondClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models1.SecondClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_second_get_second_request( headers=_headers, @@ -104,7 +104,7 @@ def get_second(self, **kwargs: Any) -> _models.SecondClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SecondClientResult, response.json()) + deserialized = _deserialize(_models1.SecondClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py index 6fae69b1001..ae9b491e736 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/aio/_operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models as _models +from ... import models as _models2 from ...._model_base import _deserialize from ..._operations._operations import build_client_namespace_second_get_second_request from .._vendor import ClientNamespaceSecondClientMixinABC @@ -39,7 +39,7 @@ class ClientNamespaceSecondClientOperationsMixin(ClientNamespaceSecondClientMixinABC): # pylint: disable=name-too-long @distributed_trace_async - async def get_second(self, **kwargs: Any) -> _models.SecondClientResult: + async def get_second(self, **kwargs: Any) -> _models2.SecondClientResult: """get_second. :return: SecondClientResult. The SecondClientResult is compatible with MutableMapping @@ -57,7 +57,7 @@ async def get_second(self, **kwargs: Any) -> _models.SecondClientResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SecondClientResult] = kwargs.pop("cls", None) + cls: ClsType[_models2.SecondClientResult] = kwargs.pop("cls", None) _request = build_client_namespace_second_get_second_request( headers=_headers, @@ -87,7 +87,7 @@ async def get_second(self, **kwargs: Any) -> _models.SecondClientResult: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SecondClientResult, response.json()) + deserialized = _deserialize(_models2.SecondClientResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py index eaaede5dbec..b7624ebb7f5 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/client/clientnamespace/second/models/_models.py @@ -13,7 +13,7 @@ from ..._model_base import rest_field if TYPE_CHECKING: - from ..sub import models as _models + from ..sub import models as _sub_models2 class SecondClientResult(_model_base.Model): @@ -23,7 +23,7 @@ class SecondClientResult(_model_base.Model): :vartype type: str or ~client.clientnamespace.models.SecondClientEnumType """ - type: Union[str, "_models.SecondClientEnumType"] = rest_field( + type: Union[str, "_sub_models2.SecondClientEnumType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Required. \"second\"""" @@ -32,7 +32,7 @@ class SecondClientResult(_model_base.Model): def __init__( self, *, - type: Union[str, "_models.SecondClientEnumType"], + type: Union[str, "_sub_models2.SecondClientEnumType"], ) -> None: ... @overload diff --git a/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json b/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json index f53258040f5..7dfbf5f5d35 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/client-naming/apiview-properties.json @@ -1,11 +1,11 @@ { "CrossLanguagePackageId": "Client.Naming", "CrossLanguageDefinitionId": { - "client.naming.model.models.ClientModel": "Client.Naming.Model.ModelWithClientClientName", - "client.naming.property.models.ClientNameAndJsonEncodedNameModel": "Client.Naming.Property.ClientNameAndJsonEncodedNameModel", - "client.naming.property.models.ClientNameModel": "Client.Naming.Property.ClientNameModel", - "client.naming.property.models.LanguageClientNameModel": "Client.Naming.Property.LanguageClientNameModel", - "client.naming.model.models.PythonModel": "Client.Naming.Model.ModelWithLanguageClientName", + "client.naming.models.ClientModel": "Client.Naming.Model.ModelWithClientClientName", + "client.naming.models.ClientNameAndJsonEncodedNameModel": "Client.Naming.Property.ClientNameAndJsonEncodedNameModel", + "client.naming.models.ClientNameModel": "Client.Naming.Property.ClientNameModel", + "client.naming.models.LanguageClientNameModel": "Client.Naming.Property.LanguageClientNameModel", + "client.naming.models.PythonModel": "Client.Naming.Model.ModelWithLanguageClientName", "client.naming.models.ClientExtensibleEnum": "Client.Naming.UnionEnum.ServerExtensibleEnum", "client.naming.models.ExtensibleEnum": "Client.Naming.UnionEnum.ExtensibleEnum", "client.naming.NamingClient.client_model.client": "Client.Naming.Model.client", diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py index 99fff63a856..7395edb6afa 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/_client.py @@ -15,10 +15,8 @@ from azure.core.rest import HttpRequest, HttpResponse from ._configuration import NamingClientConfiguration -from ._operations import NamingClientOperationsMixin from ._serialization import Deserializer, Serializer -from .model.operations import ClientModelOperations -from .unionenum.operations import UnionEnumOperations +from .operations import ClientModelOperations, NamingClientOperationsMixin, UnionEnumOperations class NamingClient(NamingClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py index 50d97733725..440347432ac 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_client.py @@ -15,10 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..model.aio.operations import ClientModelOperations -from ..unionenum.aio.operations import UnionEnumOperations from ._configuration import NamingClientConfiguration -from ._operations import NamingClientOperationsMixin +from .operations import ClientModelOperations, NamingClientOperationsMixin, UnionEnumOperations class NamingClient(NamingClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py similarity index 84% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py index 7ac2ad46845..82100c3183f 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ClientModelOperations # type: ignore +from ._operations import UnionEnumOperations # type: ignore from ._operations import NamingClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +21,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ClientModelOperations", + "UnionEnumOperations", "NamingClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py index e9e1bf65792..feb60837ffe 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py @@ -11,6 +11,7 @@ import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,8 +25,12 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict +from ... import models as _models from ..._model_base import SdkJSONEncoder -from ..._operations._operations import ( +from ..._serialization import Deserializer, Serializer +from ...operations._operations import ( + build_client_model_client_request, + build_client_model_language_request, build_naming_client_name_request, build_naming_client_request, build_naming_compatible_with_encoded_name_request, @@ -33,8 +38,10 @@ build_naming_parameter_request, build_naming_request_request, build_naming_response_request, + build_union_enum_union_enum_member_name_request, + build_union_enum_union_enum_name_request, ) -from ...property import models as _models +from .._configuration import NamingClientConfiguration from .._vendor import NamingClientMixinABC if sys.version_info >= (3, 9): @@ -46,6 +53,342 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +class ClientModelOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.aio.NamingClient`'s + :attr:`client_model` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: ~client.naming.models.ClientModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """client. + + :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_client_model_client_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def language( + self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """language. + + :param body: Required. + :type body: ~client.naming.models.PythonModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """language. + + :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_client_model_language_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class UnionEnumOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.aio.NamingClient`'s + :attr:`union_enum` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def union_enum_name(self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any) -> None: + """union_enum_name. + + :param body: "value1" Required. + :type body: str or ~client.naming.models.ClientExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def union_enum_member_name(self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any) -> None: + """union_enum_member_name. + + :param body: Known values are: "value1" and "value2". Required. + :type body: str or ~client.naming.models.ExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_member_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class NamingClientOperationsMixin(NamingClientMixinABC): @distributed_trace_async diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py deleted file mode 100644 index 3ff0937a326..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ClientModelOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClientModelOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py deleted file mode 100644 index d1e064dc7e8..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - ClientModel, - PythonModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClientModel", - "PythonModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py deleted file mode 100644 index 66f5314aa50..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_models.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ... import _model_base -from ..._model_base import rest_field - - -class ClientModel(_model_base.Model): - """ClientModel. - - :ivar default_name: Pass in true. Required. - :vartype default_name: bool - """ - - default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) - """Pass in true. Required.""" - - @overload - def __init__( - self, - *, - default_name: bool, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PythonModel(_model_base.Model): - """PythonModel. - - :ivar default_name: Pass in true. Required. - :vartype default_name: bool - """ - - default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) - """Pass in true. Required.""" - - @overload - def __init__( - self, - *, - default_name: bool, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py deleted file mode 100644 index 3ff0937a326..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ClientModelOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClientModelOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py similarity index 83% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py index b73edb03d39..4c81085e1ca 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/__init__.py @@ -14,18 +14,29 @@ from ._models import ( # type: ignore + ClientModel, ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, + PythonModel, +) + +from ._enums import ( # type: ignore + ClientExtensibleEnum, + ExtensibleEnum, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ClientModel", "ClientNameAndJsonEncodedNameModel", "ClientNameModel", "LanguageClientNameModel", + "PythonModel", + "ClientExtensibleEnum", + "ExtensibleEnum", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_enums.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_enums.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_enums.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_enums.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py similarity index 64% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py index 0dff17bc0f8..50f6302b0ee 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_models.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_models.py @@ -9,8 +9,36 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field + + +class ClientModel(_model_base.Model): + """ClientModel. + + :ivar default_name: Pass in true. Required. + :vartype default_name: bool + """ + + default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) + """Pass in true. Required.""" + + @overload + def __init__( + self, + *, + default_name: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) class ClientNameAndJsonEncodedNameModel(_model_base.Model): @@ -95,3 +123,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + + +class PythonModel(_model_base.Model): + """PythonModel. + + :ivar default_name: Pass in true. Required. + :vartype default_name: bool + """ + + default_name: bool = rest_field(name="defaultName", visibility=["read", "create", "update", "delete", "query"]) + """Pass in true. Required.""" + + @overload + def __init__( + self, + *, + default_name: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/models/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py similarity index 84% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py index 7ac2ad46845..82100c3183f 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ClientModelOperations # type: ignore +from ._operations import UnionEnumOperations # type: ignore from ._operations import NamingClientOperationsMixin # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +21,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ClientModelOperations", + "UnionEnumOperations", "NamingClientOperationsMixin", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py index 7efe47c6117..7b535881495 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -10,6 +11,7 @@ import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,10 +25,11 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict +from .. import models as _models +from .._configuration import NamingClientConfiguration from .._model_base import SdkJSONEncoder -from .._serialization import Serializer +from .._serialization import Deserializer, Serializer from .._vendor import NamingClientMixinABC -from ..property import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -40,6 +43,60 @@ _SERIALIZER.client_side_validation = False +def build_client_model_client_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/client/naming/model/client" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_client_model_language_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/client/naming/model/language" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_union_enum_union_enum_name_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/client/naming/union-enum/union-enum-name" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_union_enum_union_enum_member_name_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: str = kwargs.pop("content_type") + # Construct URL + _url = "/client/naming/union-enum/union-enum-member-name" + + # Construct headers + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + def build_naming_client_name_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/client/naming/operation" @@ -120,6 +177,348 @@ def build_naming_response_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, **kwargs) +class ClientModelOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.NamingClient`'s + :attr:`client_model` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: ~client.naming.models.ClientModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """client. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def client( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """client. + + :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_client_model_client_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def language(self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. + + :param body: Required. + :type body: ~client.naming.models.PythonModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """language. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def language( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """language. + + :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. + :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_client_model_language_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class UnionEnumOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.naming.NamingClient`'s + :attr:`union_enum` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def union_enum_name( # pylint: disable=inconsistent-return-statements + self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any + ) -> None: + """union_enum_name. + + :param body: "value1" Required. + :type body: str or ~client.naming.models.ClientExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def union_enum_member_name( # pylint: disable=inconsistent-return-statements + self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any + ) -> None: + """union_enum_member_name. + + :param body: Known values are: "value1" and "value2". Required. + :type body: str or ~client.naming.models.ExtensibleEnum + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_union_enum_union_enum_member_name_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class NamingClientOperationsMixin(NamingClientMixinABC): @distributed_trace diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_patch.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/sharedmodelinoperation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py deleted file mode 100644 index a748f5b26cf..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import UnionEnumOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "UnionEnumOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py deleted file mode 100644 index df8fbba54d2..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_operations.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import json -import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import NamingClientConfiguration -from ...operations._operations import ( - build_union_enum_union_enum_member_name_request, - build_union_enum_union_enum_name_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class UnionEnumOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.aio.NamingClient`'s - :attr:`union_enum` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def union_enum_name(self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any) -> None: - """union_enum_name. - - :param body: "value1" Required. - :type body: str or ~client.naming.models.ClientExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def union_enum_member_name(self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any) -> None: - """union_enum_member_name. - - :param body: Known values are: "value1" and "value2". Required. - :type body: str or ~client.naming.models.ExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_member_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py deleted file mode 100644 index b9f176e9350..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._enums import ( # type: ignore - ClientExtensibleEnum, - ExtensibleEnum, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ClientExtensibleEnum", - "ExtensibleEnum", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py deleted file mode 100644 index a748f5b26cf..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import UnionEnumOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "UnionEnumOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py deleted file mode 100644 index 9693f3c5bab..00000000000 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_operations.py +++ /dev/null @@ -1,189 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import json -import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import NamingClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_union_enum_union_enum_name_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/client/naming/union-enum/union-enum-name" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_union_enum_union_enum_member_name_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/client/naming/union-enum/union-enum-member-name" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class UnionEnumOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.naming.NamingClient`'s - :attr:`union_enum` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def union_enum_name( # pylint: disable=inconsistent-return-statements - self, body: Union[str, _models.ClientExtensibleEnum], **kwargs: Any - ) -> None: - """union_enum_name. - - :param body: "value1" Required. - :type body: str or ~client.naming.models.ClientExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def union_enum_member_name( # pylint: disable=inconsistent-return-statements - self, body: Union[str, _models.ExtensibleEnum], **kwargs: Any - ) -> None: - """union_enum_member_name. - - :param body: Known values are: "value1" and "value2". Required. - :type body: str or ~client.naming.models.ExtensibleEnum - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_union_enum_union_enum_member_name_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py index b6a75654931..14f4ad71030 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py @@ -17,9 +17,7 @@ from . import models as _models from ._configuration import ServiceClientConfiguration from ._serialization import Deserializer, Serializer -from .baz.operations import BazOperations -from .operations import BarOperations, FooOperations, ServiceClientOperationsMixin -from .qux.operations import QuxOperations +from .operations import BarOperations, BazOperations, FooOperations, QuxOperations, ServiceClientOperationsMixin class ServiceClient(ServiceClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py index ada2682da91..a59b3a26d57 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py @@ -16,10 +16,8 @@ from .. import models as _models from .._serialization import Deserializer, Serializer -from ..baz.aio.operations import BazOperations -from ..qux.aio.operations import QuxOperations from ._configuration import ServiceClientConfiguration -from .operations import BarOperations, FooOperations, ServiceClientOperationsMixin +from .operations import BarOperations, BazOperations, FooOperations, QuxOperations, ServiceClientOperationsMixin class ServiceClient(ServiceClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py index 7a5f390b339..3560145a703 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import BazOperations # type: ignore +from ._operations import QuxOperations # type: ignore from ._operations import FooOperations # type: ignore from ._operations import BarOperations # type: ignore from ._operations import ServiceClientOperationsMixin # type: ignore @@ -21,6 +23,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "BazOperations", + "QuxOperations", "FooOperations", "BarOperations", "ServiceClientOperationsMixin", diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index 7c85c16509a..88bf08cc6a1 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -26,8 +26,11 @@ from ...operations._operations import ( build_bar_five_request, build_bar_six_request, + build_baz_foo_seven_request, build_foo_four_request, build_foo_three_request, + build_qux_bar_nine_request, + build_qux_eight_request, build_service_one_request, build_service_two_request, ) @@ -42,6 +45,91 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +class BazOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`baz` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) + + +class QuxOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`qux` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) + + @distributed_trace_async + async def eight(self, **kwargs: Any) -> None: + """eight. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_eight_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class FooOperations: """ .. warning:: @@ -349,3 +437,129 @@ async def two(self, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore + + +class BazFooOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`foo` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def seven(self, **kwargs: Any) -> None: + """seven. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_baz_foo_seven_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QuxBarOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.aio.ServiceClient`'s + :attr:`bar` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def nine(self, **kwargs: Any) -> None: + """nine. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_bar_nine_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py deleted file mode 100644 index b4a3b318840..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import BazOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "BazOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py deleted file mode 100644 index 6d4d32f5dac..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_operations.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import ServiceClientConfiguration -from ...operations._operations import build_baz_foo_seven_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BazOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`baz` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) - - -class BazFooOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`foo` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def seven(self, **kwargs: Any) -> None: - """seven. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_baz_foo_seven_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py deleted file mode 100644 index b4a3b318840..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import BazOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "BazOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py deleted file mode 100644 index 3b901e16c9b..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_operations.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from ..._configuration import ServiceClientConfiguration -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_baz_foo_seven_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/seven" - - return HttpRequest(method="POST", url=_url, **kwargs) - - -class BazOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`baz` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) - - -class BazFooOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`foo` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """seven. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_baz_foo_seven_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py index 7a5f390b339..3560145a703 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import BazOperations # type: ignore +from ._operations import QuxOperations # type: ignore from ._operations import FooOperations # type: ignore from ._operations import BarOperations # type: ignore from ._operations import ServiceClientOperationsMixin # type: ignore @@ -21,6 +23,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "BazOperations", + "QuxOperations", "FooOperations", "BarOperations", "ServiceClientOperationsMixin", diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py index f5590ae3ed6..5dc8e031ea2 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -36,6 +36,13 @@ _SERIALIZER.client_side_validation = False +def build_qux_eight_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/eight" + + return HttpRequest(method="POST", url=_url, **kwargs) + + def build_foo_three_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/three" @@ -78,6 +85,105 @@ def build_service_two_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, **kwargs) +def build_baz_foo_seven_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/seven" + + return HttpRequest(method="POST", url=_url, **kwargs) + + +def build_qux_bar_nine_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/nine" + + return HttpRequest(method="POST", url=_url, **kwargs) + + +class BazOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`baz` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.foo = BazFooOperations(self._client, self._config, self._serialize, self._deserialize) + + +class QuxOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`qux` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) + + @distributed_trace + def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """eight. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_eight_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class FooOperations: """ .. warning:: @@ -385,3 +491,129 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) # type: ignore + + +class BazFooOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`foo` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """seven. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_baz_foo_seven_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QuxBarOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~client.structure.service.ServiceClient`'s + :attr:`bar` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """nine. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_qux_bar_nine_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py deleted file mode 100644 index fde2c7d7e1c..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QuxOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QuxOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py deleted file mode 100644 index a792374cd9b..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_operations.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import ServiceClientConfiguration -from ...operations._operations import build_qux_bar_nine_request, build_qux_eight_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class QuxOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`qux` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) - - @distributed_trace_async - async def eight(self, **kwargs: Any) -> None: - """eight. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_eight_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QuxBarOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.aio.ServiceClient`'s - :attr:`bar` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def nine(self, **kwargs: Any) -> None: - """nine. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_bar_nine_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py deleted file mode 100644 index fde2c7d7e1c..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QuxOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QuxOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py deleted file mode 100644 index 9d5fc6ad969..00000000000 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_operations.py +++ /dev/null @@ -1,177 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from ..._configuration import ServiceClientConfiguration -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_qux_eight_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/eight" - - return HttpRequest(method="POST", url=_url, **kwargs) - - -def build_qux_bar_nine_request(**kwargs: Any) -> HttpRequest: - # Construct URL - _url = "/nine" - - return HttpRequest(method="POST", url=_url, **kwargs) - - -class QuxOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`qux` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.bar = QuxBarOperations(self._client, self._config, self._serialize, self._deserialize) - - @distributed_trace - def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """eight. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_eight_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class QuxBarOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~client.structure.service.ServiceClient`'s - :attr:`bar` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """nine. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_qux_bar_nine_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "client": self._serialize.url("self._config.client", self._config.client, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py index 06696b42f49..4c106bca77a 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import BytesClientConfiguration @@ -65,8 +65,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: _models3.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -82,7 +82,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -98,7 +98,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -113,8 +113,8 @@ async def default( @distributed_trace_async async def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: Union[_models3.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -135,7 +135,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -174,7 +174,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models3.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -183,8 +183,8 @@ async def default( @overload async def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: _models3.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -200,7 +200,7 @@ async def base64( @overload async def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -216,7 +216,7 @@ async def base64( @overload async def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -231,8 +231,8 @@ async def base64( @distributed_trace_async async def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: Union[_models3.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -253,7 +253,7 @@ async def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -292,7 +292,7 @@ async def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -301,8 +301,8 @@ async def base64( @overload async def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: _models3.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -318,7 +318,7 @@ async def base64_url( @overload async def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -334,7 +334,7 @@ async def base64_url( @overload async def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -349,8 +349,8 @@ async def base64_url( @distributed_trace_async async def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: Union[_models3.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -371,7 +371,7 @@ async def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -410,7 +410,7 @@ async def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -419,8 +419,8 @@ async def base64_url( @overload async def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: _models3.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -437,7 +437,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -454,7 +454,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -470,8 +470,8 @@ async def base64_url_array( @distributed_trace_async async def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: Union[_models3.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -494,7 +494,7 @@ async def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -533,7 +533,7 @@ async def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py index 1ca521d55b0..d6453ec92c3 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/property/operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import BytesClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -130,8 +130,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: _models2.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -147,7 +147,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -163,7 +163,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -178,8 +178,8 @@ def default( @distributed_trace def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: Union[_models2.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -200,7 +200,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -239,7 +239,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models2.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -248,8 +248,8 @@ def default( @overload def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: _models2.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -265,7 +265,7 @@ def base64( @overload def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -281,7 +281,7 @@ def base64( @overload def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -296,8 +296,8 @@ def base64( @distributed_trace def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: Union[_models2.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -318,7 +318,7 @@ def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -357,7 +357,7 @@ def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -366,8 +366,8 @@ def base64( @overload def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: _models2.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -383,7 +383,7 @@ def base64_url( @overload def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -399,7 +399,7 @@ def base64_url( @overload def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -414,8 +414,8 @@ def base64_url( @distributed_trace def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: Union[_models2.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -436,7 +436,7 @@ def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -475,7 +475,7 @@ def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -484,8 +484,8 @@ def base64_url( @overload def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: _models2.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -502,7 +502,7 @@ def base64_url_array( @overload def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -519,7 +519,7 @@ def base64_url_array( @overload def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -535,8 +535,8 @@ def base64_url_array( @distributed_trace def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: Union[_models2.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -559,7 +559,7 @@ def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -598,7 +598,7 @@ def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py index 68be3c22a6b..7cba6f88e3c 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import DatetimeClientConfiguration @@ -66,8 +66,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: _models3.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -83,7 +83,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -99,7 +99,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -114,8 +114,8 @@ async def default( @distributed_trace_async async def default( - self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: Union[_models3.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -136,7 +136,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -175,7 +175,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -184,8 +184,8 @@ async def default( @overload async def rfc3339( - self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: _models3.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -201,7 +201,7 @@ async def rfc3339( @overload async def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -217,7 +217,7 @@ async def rfc3339( @overload async def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -232,8 +232,8 @@ async def rfc3339( @distributed_trace_async async def rfc3339( - self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: Union[_models3.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -254,7 +254,7 @@ async def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -293,7 +293,7 @@ async def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models3.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -302,8 +302,8 @@ async def rfc3339( @overload async def rfc7231( - self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: _models3.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -319,7 +319,7 @@ async def rfc7231( @overload async def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -335,7 +335,7 @@ async def rfc7231( @overload async def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -350,8 +350,8 @@ async def rfc7231( @distributed_trace_async async def rfc7231( - self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: Union[_models3.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -372,7 +372,7 @@ async def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -411,7 +411,7 @@ async def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models3.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -420,8 +420,8 @@ async def rfc7231( @overload async def unix_timestamp( - self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: _models3.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -438,7 +438,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -455,7 +455,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -471,8 +471,8 @@ async def unix_timestamp( @distributed_trace_async async def unix_timestamp( - self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: Union[_models3.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -495,7 +495,7 @@ async def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -534,7 +534,7 @@ async def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -543,8 +543,12 @@ async def unix_timestamp( @overload async def unix_timestamp_array( - self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, + body: _models3.UnixTimestampArrayDatetimeProperty, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -561,7 +565,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -578,7 +582,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -594,8 +598,8 @@ async def unix_timestamp_array( @distributed_trace_async async def unix_timestamp_array( - self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models3.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -618,7 +622,7 @@ async def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -657,7 +661,7 @@ async def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py index 24fecdf59b1..175c05da5f7 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/property/operations/_operations.py @@ -26,7 +26,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import DatetimeClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -147,8 +147,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: _models2.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -164,7 +164,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -180,7 +180,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -195,8 +195,8 @@ def default( @distributed_trace def default( - self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: Union[_models2.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -217,7 +217,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -256,7 +256,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -265,8 +265,8 @@ def default( @overload def rfc3339( - self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: _models2.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -282,7 +282,7 @@ def rfc3339( @overload def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -298,7 +298,7 @@ def rfc3339( @overload def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -313,8 +313,8 @@ def rfc3339( @distributed_trace def rfc3339( - self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: Union[_models2.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -335,7 +335,7 @@ def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -374,7 +374,7 @@ def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models2.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -383,8 +383,8 @@ def rfc3339( @overload def rfc7231( - self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: _models2.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -400,7 +400,7 @@ def rfc7231( @overload def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -416,7 +416,7 @@ def rfc7231( @overload def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -431,8 +431,8 @@ def rfc7231( @distributed_trace def rfc7231( - self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: Union[_models2.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -453,7 +453,7 @@ def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -492,7 +492,7 @@ def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models2.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -501,8 +501,8 @@ def rfc7231( @overload def unix_timestamp( - self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: _models2.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -519,7 +519,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -536,7 +536,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -552,8 +552,8 @@ def unix_timestamp( @distributed_trace def unix_timestamp( - self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: Union[_models2.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -576,7 +576,7 @@ def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -615,7 +615,7 @@ def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -624,8 +624,12 @@ def unix_timestamp( @overload def unix_timestamp_array( - self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, + body: _models2.UnixTimestampArrayDatetimeProperty, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -642,7 +646,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -659,7 +663,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -675,8 +679,8 @@ def unix_timestamp_array( @distributed_trace def unix_timestamp_array( - self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models2.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -699,7 +703,7 @@ def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -738,7 +742,7 @@ def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json b/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json index 8f6082f2de0..0d62c4e2e33 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/encode-duration/apiview-properties.json @@ -1,12 +1,12 @@ { "CrossLanguagePackageId": "Encode.Duration", "CrossLanguageDefinitionId": { - "encode.duration.property.models.DefaultDurationProperty": "Encode.Duration.Property.DefaultDurationProperty", - "encode.duration.property.models.Float64SecondsDurationProperty": "Encode.Duration.Property.Float64SecondsDurationProperty", - "encode.duration.property.models.FloatSecondsDurationArrayProperty": "Encode.Duration.Property.FloatSecondsDurationArrayProperty", - "encode.duration.property.models.FloatSecondsDurationProperty": "Encode.Duration.Property.FloatSecondsDurationProperty", - "encode.duration.property.models.Int32SecondsDurationProperty": "Encode.Duration.Property.Int32SecondsDurationProperty", - "encode.duration.property.models.ISO8601DurationProperty": "Encode.Duration.Property.ISO8601DurationProperty", + "encode.duration.models.DefaultDurationProperty": "Encode.Duration.Property.DefaultDurationProperty", + "encode.duration.models.Float64SecondsDurationProperty": "Encode.Duration.Property.Float64SecondsDurationProperty", + "encode.duration.models.FloatSecondsDurationArrayProperty": "Encode.Duration.Property.FloatSecondsDurationArrayProperty", + "encode.duration.models.FloatSecondsDurationProperty": "Encode.Duration.Property.FloatSecondsDurationProperty", + "encode.duration.models.Int32SecondsDurationProperty": "Encode.Duration.Property.Int32SecondsDurationProperty", + "encode.duration.models.ISO8601DurationProperty": "Encode.Duration.Property.ISO8601DurationProperty", "encode.duration.DurationClient.query.default": "Encode.Duration.Query.default", "encode.duration.DurationClient.query.iso8601": "Encode.Duration.Query.iso8601", "encode.duration.DurationClient.query.int32_seconds": "Encode.Duration.Query.int32Seconds", diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py index 8fa1c00a3fb..5250920b20b 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/_client.py @@ -16,9 +16,7 @@ from ._configuration import DurationClientConfiguration from ._serialization import Deserializer, Serializer -from .header.operations import HeaderOperations -from .property.operations import PropertyOperations -from .query.operations import QueryOperations +from .operations import HeaderOperations, PropertyOperations, QueryOperations class DurationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py index bdd7f4df106..4f9fcff8eda 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/_client.py @@ -15,10 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..header.aio.operations import HeaderOperations -from ..property.aio.operations import PropertyOperations -from ..query.aio.operations import QueryOperations from ._configuration import DurationClientConfiguration +from .operations import HeaderOperations, PropertyOperations, QueryOperations class DurationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py similarity index 85% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py index 22f11074013..543a6758629 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/__init__.py @@ -12,14 +12,18 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import QueryOperations # type: ignore from ._operations import PropertyOperations # type: ignore +from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "QueryOperations", "PropertyOperations", + "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py similarity index 59% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py index efe6de82e88..ebd6dcb3fa8 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -27,25 +29,337 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import SdkJSONEncoder, _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import DurationClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( + build_header_default_request, + build_header_float64_seconds_request, + build_header_float_seconds_request, + build_header_int32_seconds_request, + build_header_iso8601_array_request, + build_header_iso8601_request, build_property_default_request, build_property_float64_seconds_request, build_property_float_seconds_array_request, build_property_float_seconds_request, build_property_int32_seconds_request, build_property_iso8601_request, + build_query_default_request, + build_query_float64_seconds_request, + build_query_float_seconds_request, + build_query_int32_seconds_array_request, + build_query_int32_seconds_request, + build_query_iso8601_request, ) +from .._configuration import DurationClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.aio.DurationClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, input: datetime.timedelta, **kwargs: Any) -> None: + """default. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601(self, *, input: datetime.timedelta, **kwargs: Any) -> None: + """iso8601. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_iso8601_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds(self, *, input: int, **kwargs: Any) -> None: + """int32_seconds. + + :keyword input: Required. + :paramtype input: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float_seconds(self, *, input: float, **kwargs: Any) -> None: + """float_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float64_seconds(self, *, input: float, **kwargs: Any) -> None: + """float64_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float64_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds_array(self, *, input: List[int], **kwargs: Any) -> None: + """int32_seconds_array. + + :keyword input: Required. + :paramtype input: list[int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_array_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore class PropertyOperations: @@ -792,3 +1106,303 @@ async def float_seconds_array( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.aio.DurationClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def default(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: + """default. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: + """iso8601. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def iso8601_array(self, *, duration: List[datetime.timedelta], **kwargs: Any) -> None: + """iso8601_array. + + :keyword duration: Required. + :paramtype duration: list[~datetime.timedelta] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_array_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: + """int32_seconds. + + :keyword duration: Required. + :paramtype duration: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_int32_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float_seconds(self, *, duration: float, **kwargs: Any) -> None: + """float_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def float64_seconds(self, *, duration: float, **kwargs: Any) -> None: + """float64_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float64_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py deleted file mode 100644 index 1ab30f60268..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import HeaderOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "HeaderOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py deleted file mode 100644 index 9766153c063..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_operations.py +++ /dev/null @@ -1,341 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import datetime -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import DurationClientConfiguration -from ...operations._operations import ( - build_header_default_request, - build_header_float64_seconds_request, - build_header_float_seconds_request, - build_header_int32_seconds_request, - build_header_iso8601_array_request, - build_header_iso8601_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.aio.DurationClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: - """default. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601(self, *, duration: datetime.timedelta, **kwargs: Any) -> None: - """iso8601. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601_array(self, *, duration: List[datetime.timedelta], **kwargs: Any) -> None: - """iso8601_array. - - :keyword duration: Required. - :paramtype duration: list[~datetime.timedelta] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_array_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: - """int32_seconds. - - :keyword duration: Required. - :paramtype duration: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_int32_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float_seconds(self, *, duration: float, **kwargs: Any) -> None: - """float_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float64_seconds(self, *, duration: float, **kwargs: Any) -> None: - """float64_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float64_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py deleted file mode 100644 index 1ab30f60268..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import HeaderOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "HeaderOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py deleted file mode 100644 index fa142366b7d..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_operations.py +++ /dev/null @@ -1,419 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import datetime -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from ..._configuration import DurationClientConfiguration -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_header_default_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/default" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_iso8601_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/iso8601" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_iso8601_array_request(*, duration: List[datetime.timedelta], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/iso8601-array" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "[duration]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_int32_seconds_request(*, duration: int, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/int32-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "int") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_float_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/float-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "float") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_float64_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/duration/header/float64-seconds" - - # Construct headers - _headers["duration"] = _SERIALIZER.header("duration", duration, "float") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.DurationClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, duration: datetime.timedelta, **kwargs: Any - ) -> None: - """default. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601( # pylint: disable=inconsistent-return-statements - self, *, duration: datetime.timedelta, **kwargs: Any - ) -> None: - """iso8601. - - :keyword duration: Required. - :paramtype duration: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601_array( # pylint: disable=inconsistent-return-statements - self, *, duration: List[datetime.timedelta], **kwargs: Any - ) -> None: - """iso8601_array. - - :keyword duration: Required. - :paramtype duration: list[~datetime.timedelta] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_iso8601_array_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """int32_seconds. - - :keyword duration: Required. - :paramtype duration: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_int32_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float_seconds( # pylint: disable=inconsistent-return-statements - self, *, duration: float, **kwargs: Any - ) -> None: - """float_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float64_seconds( # pylint: disable=inconsistent-return-statements - self, *, duration: float, **kwargs: Any - ) -> None: - """float64_seconds. - - :keyword duration: Required. - :paramtype duration: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_float64_seconds_request( - duration=duration, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py similarity index 98% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py index 17debec1547..a55bf7e46c4 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_models.py @@ -10,8 +10,8 @@ import datetime from typing import Any, List, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class DefaultDurationProperty(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/models/_patch.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py similarity index 85% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py index 22f11074013..543a6758629 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/__init__.py @@ -12,14 +12,18 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import QueryOperations # type: ignore from ._operations import PropertyOperations # type: ignore +from ._operations import HeaderOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "QueryOperations", "PropertyOperations", + "HeaderOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py index e06695c3f36..bee4d3958c5 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -27,22 +29,94 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import DurationClientConfiguration -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from .._configuration import DurationClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False +def build_query_default_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/default" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "duration") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_iso8601_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/iso8601" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "duration") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_int32_seconds_request(*, input: int, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/int32-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "int") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_float_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/float-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "float") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_float64_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/float64-seconds" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "float") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_int32_seconds_array_request(*, input: List[int], **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/encode/duration/query/int32-seconds-array" + + # Construct parameters + _params["input"] = _SERIALIZER.query("input", input, "[int]", div=",") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + def build_property_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -125,24 +199,402 @@ def build_property_float64_seconds_request(**kwargs: Any) -> HttpRequest: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_property_float_seconds_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/encode/duration/property/float-seconds-array" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_header_default_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/default" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_iso8601_request(*, duration: datetime.timedelta, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/iso8601" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "duration") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_iso8601_array_request(*, duration: List[datetime.timedelta], **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/iso8601-array" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "[duration]", div=",") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_int32_seconds_request(*, duration: int, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/int32-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "int") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_float_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/float-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "float") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_header_float64_seconds_request(*, duration: float, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/encode/duration/header/float64-seconds" + + # Construct headers + _headers["duration"] = _SERIALIZER.header("duration", duration, "float") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +class QueryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.DurationClient`'s + :attr:`query` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, input: datetime.timedelta, **kwargs: Any + ) -> None: + """default. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_default_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601( # pylint: disable=inconsistent-return-statements + self, *, input: datetime.timedelta, **kwargs: Any + ) -> None: + """iso8601. + + :keyword input: Required. + :paramtype input: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_iso8601_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """int32_seconds. + + :keyword input: Required. + :paramtype input: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_int32_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """float_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float64_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """float64_seconds. + + :keyword input: Required. + :paramtype input: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_float64_seconds_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds_array( # pylint: disable=inconsistent-return-statements + self, *, input: List[int], **kwargs: Any + ) -> None: + """int32_seconds_array. + + :keyword input: Required. + :paramtype input: list[int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + cls: ClsType[None] = kwargs.pop("cls", None) -def build_property_float_seconds_array_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _request = build_query_int32_seconds_array_request( + input=input, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - # Construct URL - _url = "/encode/duration/property/float-seconds-array" + response = pipeline_response.http_response - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + if cls: + return cls(pipeline_response, None, {}) # type: ignore class PropertyOperations: @@ -889,3 +1341,313 @@ def float_seconds_array( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + +class HeaderOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~encode.duration.DurationClient`'s + :attr:`header` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def default( # pylint: disable=inconsistent-return-statements + self, *, duration: datetime.timedelta, **kwargs: Any + ) -> None: + """default. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_default_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601( # pylint: disable=inconsistent-return-statements + self, *, duration: datetime.timedelta, **kwargs: Any + ) -> None: + """iso8601. + + :keyword duration: Required. + :paramtype duration: ~datetime.timedelta + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def iso8601_array( # pylint: disable=inconsistent-return-statements + self, *, duration: List[datetime.timedelta], **kwargs: Any + ) -> None: + """iso8601_array. + + :keyword duration: Required. + :paramtype duration: list[~datetime.timedelta] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_iso8601_array_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """int32_seconds. + + :keyword duration: Required. + :paramtype duration: int + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_int32_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float_seconds( # pylint: disable=inconsistent-return-statements + self, *, duration: float, **kwargs: Any + ) -> None: + """float_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def float64_seconds( # pylint: disable=inconsistent-return-statements + self, *, duration: float, **kwargs: Any + ) -> None: + """float64_seconds. + + :keyword duration: Required. + :paramtype duration: float + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_header_float64_seconds_request( + duration=duration, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/modelinoperation/operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py deleted file mode 100644 index 97d3de4f9b2..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py deleted file mode 100644 index f201c580435..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_operations.py +++ /dev/null @@ -1,341 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import datetime -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import DurationClientConfiguration -from ...operations._operations import ( - build_query_default_request, - build_query_float64_seconds_request, - build_query_float_seconds_request, - build_query_int32_seconds_array_request, - build_query_int32_seconds_request, - build_query_iso8601_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.aio.DurationClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, input: datetime.timedelta, **kwargs: Any) -> None: - """default. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def iso8601(self, *, input: datetime.timedelta, **kwargs: Any) -> None: - """iso8601. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_iso8601_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds(self, *, input: int, **kwargs: Any) -> None: - """int32_seconds. - - :keyword input: Required. - :paramtype input: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float_seconds(self, *, input: float, **kwargs: Any) -> None: - """float_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def float64_seconds(self, *, input: float, **kwargs: Any) -> None: - """float64_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float64_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def int32_seconds_array(self, *, input: List[int], **kwargs: Any) -> None: - """int32_seconds_array. - - :keyword input: Required. - :paramtype input: list[int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_array_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py deleted file mode 100644 index 97d3de4f9b2..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import QueryOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "QueryOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py deleted file mode 100644 index ce253fe1865..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_operations.py +++ /dev/null @@ -1,415 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import datetime -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from ..._configuration import DurationClientConfiguration -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_query_default_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/default" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "duration") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_iso8601_request(*, input: datetime.timedelta, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/iso8601" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "duration") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_int32_seconds_request(*, input: int, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/int32-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "int") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_float_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/float-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "float") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_float64_seconds_request(*, input: float, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/float64-seconds" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "float") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_int32_seconds_array_request(*, input: List[int], **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/duration/query/int32-seconds-array" - - # Construct parameters - _params["input"] = _SERIALIZER.query("input", input, "[int]", div=",") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.duration.DurationClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default( # pylint: disable=inconsistent-return-statements - self, *, input: datetime.timedelta, **kwargs: Any - ) -> None: - """default. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def iso8601( # pylint: disable=inconsistent-return-statements - self, *, input: datetime.timedelta, **kwargs: Any - ) -> None: - """iso8601. - - :keyword input: Required. - :paramtype input: ~datetime.timedelta - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_iso8601_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """int32_seconds. - - :keyword input: Required. - :paramtype input: int - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """float_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def float64_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """float64_seconds. - - :keyword input: Required. - :paramtype input: float - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_float64_seconds_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def int32_seconds_array( # pylint: disable=inconsistent-return-statements - self, *, input: List[int], **kwargs: Any - ) -> None: - """int32_seconds_array. - - :keyword input: Required. - :paramtype input: list[int] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_int32_seconds_array_request( - input=input, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/query/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json b/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json index 605460c05bb..14141434976 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/encode-numeric/apiview-properties.json @@ -1,9 +1,9 @@ { "CrossLanguagePackageId": "Encode.Numeric", "CrossLanguageDefinitionId": { - "encode.numeric.property.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", - "encode.numeric.property.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", - "encode.numeric.property.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty", + "encode.numeric.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", + "encode.numeric.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", + "encode.numeric.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty", "encode.numeric.NumericClient.property.safeint_as_string": "Encode.Numeric.Property.safeintAsString", "encode.numeric.NumericClient.property.uint32_as_string_optional": "Encode.Numeric.Property.uint32AsStringOptional", "encode.numeric.NumericClient.property.uint8_as_string": "Encode.Numeric.Property.uint8AsString" diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py index a94212dc76a..23ea0b25ec4 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/_client.py @@ -16,7 +16,7 @@ from ._configuration import NumericClientConfiguration from ._serialization import Deserializer, Serializer -from .property.operations import PropertyOperations +from .operations import PropertyOperations class NumericClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py index 90bfe9ada6b..805a5d849c2 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..property.aio.operations import PropertyOperations from ._configuration import NumericClientConfiguration +from .operations import PropertyOperations class NumericClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py index 17e7a8b8068..1bb072b5cc8 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py @@ -27,14 +27,14 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import SdkJSONEncoder, _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import NumericClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_property_safeint_as_string_request, build_property_uint32_as_string_optional_request, build_property_uint8_as_string_request, ) +from .._configuration import NumericClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/__init__.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py similarity index 97% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py index 3522012d118..91af13a3300 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, Optional, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class SafeintAsStringProperty(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/_patch.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/property/operations/__init__.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py similarity index 99% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py index cc46c9e81e5..0f5715ee7a0 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import NumericClientConfiguration -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from .._configuration import NumericClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json b/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json index 84689902892..3f5d96dd1ca 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/parameters-basic/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Parameters.Basic", "CrossLanguageDefinitionId": { - "parameters.basic.explicitbody.models.User": "Parameters.Basic.ExplicitBody.User", + "parameters.basic.models.User": "Parameters.Basic.ExplicitBody.User", "parameters.basic.BasicClient.explicit_body.simple": "Parameters.Basic.ExplicitBody.simple", "parameters.basic.BasicClient.implicit_body.simple": "Parameters.Basic.ImplicitBody.simple" } diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py index ec80a50fd3e..76c418fd795 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/_client.py @@ -16,8 +16,7 @@ from ._configuration import BasicClientConfiguration from ._serialization import Deserializer, Serializer -from .explicitbody.operations import ExplicitBodyOperations -from .implicitbody.operations import ImplicitBodyOperations +from .operations import ExplicitBodyOperations, ImplicitBodyOperations class BasicClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py index 971d86d9688..1a86654cf72 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/_client.py @@ -15,9 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..explicitbody.aio.operations import ExplicitBodyOperations -from ..implicitbody.aio.operations import ImplicitBodyOperations from ._configuration import BasicClientConfiguration +from .operations import ExplicitBodyOperations, ImplicitBodyOperations class BasicClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py index c70354e72dc..e6d8ddd24ac 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/__init__.py @@ -13,6 +13,7 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import ExplicitBodyOperations # type: ignore +from ._operations import ImplicitBodyOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -20,6 +21,7 @@ __all__ = [ "ExplicitBodyOperations", + "ImplicitBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py similarity index 72% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py index 063a604a6da..fc7afacdbe6 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_operations.py @@ -25,10 +25,10 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import NamingClientConfiguration -from ...operations._operations import build_client_model_client_request, build_client_model_language_request +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer +from ...operations._operations import build_explicit_body_simple_request, build_implicit_body_simple_request +from .._configuration import BasicClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -37,31 +37,32 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +_Unset: Any = object() -class ClientModelOperations: +class ExplicitBodyOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~client.naming.aio.NamingClient`'s - :attr:`client_model` attribute. + :class:`~parameters.basic.aio.BasicClient`'s + :attr:`explicit_body` attribute. """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. - :type body: ~client.naming.models.ClientModel + :type body: ~parameters.basic.models.User :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -71,8 +72,8 @@ async def client(self, body: _models.ClientModel, *, content_type: str = "applic """ @overload - async def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: JSON @@ -85,8 +86,8 @@ async def client(self, body: JSON, *, content_type: str = "application/json", ** """ @overload - async def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: IO[bytes] @@ -99,11 +100,11 @@ async def client(self, body: IO[bytes], *, content_type: str = "application/json """ @distributed_trace_async - async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """client. + async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: + """simple. - :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] + :param body: Is one of the following types: User, JSON, IO[bytes] Required. + :type body: ~parameters.basic.models.User or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -129,7 +130,7 @@ async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwar else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_client_model_client_request( + _request = build_explicit_body_simple_request( content_type=content_type, content=_content, headers=_headers, @@ -154,14 +155,30 @@ async def client(self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwar if cls: return cls(pipeline_response, None, {}) # type: ignore + +class ImplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.aio.BasicClient`'s + :attr:`implicit_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - async def language( - self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """language. + async def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. - :param body: Required. - :type body: ~client.naming.models.PythonModel + :keyword name: Required. + :paramtype name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -171,8 +188,8 @@ async def language( """ @overload - async def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. + async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: JSON @@ -185,8 +202,8 @@ async def language(self, body: JSON, *, content_type: str = "application/json", """ @overload - async def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. + async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: IO[bytes] @@ -199,11 +216,13 @@ async def language(self, body: IO[bytes], *, content_type: str = "application/js """ @distributed_trace_async - async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """language. + async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any) -> None: + """simple. - :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -222,6 +241,11 @@ async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kw content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -229,7 +253,7 @@ async def language(self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kw else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_client_model_language_request( + _request = build_implicit_body_simple_request( content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-example-basic/azureexamplebasicclient/aio/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py deleted file mode 100644 index 0c990b7501a..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import BasicClientConfiguration -from ...operations._operations import build_explicit_body_simple_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ExplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.aio.BasicClient`'s - :attr:`explicit_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: ~parameters.basic.models.User - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: - """simple. - - :param body: Is one of the following types: User, JSON, IO[bytes] Required. - :type body: ~parameters.basic.models.User or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_explicit_body_simple_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py deleted file mode 100644 index 31c14fda761..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import BasicClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_explicit_body_simple_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/basic/explicit-body/simple" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -class ExplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.BasicClient`'s - :attr:`explicit_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: ~parameters.basic.models.User - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """simple. - - :param body: Is one of the following types: User, JSON, IO[bytes] Required. - :type body: ~parameters.basic.models.User or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_explicit_body_simple_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py deleted file mode 100644 index 5fcf24c10f3..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ImplicitBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ImplicitBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py deleted file mode 100644 index b366bffd3af..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_operations.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import BasicClientConfiguration -from ...operations._operations import build_implicit_body_simple_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ImplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.aio.BasicClient`'s - :attr:`implicit_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def simple(self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any) -> None: - """simple. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_implicit_body_simple_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py deleted file mode 100644 index 5fcf24c10f3..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ImplicitBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ImplicitBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py deleted file mode 100644 index 9de19134ec7..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from ..._configuration import BasicClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_implicit_body_simple_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/basic/implicit-body/simple" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -class ImplicitBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.basic.BasicClient`'s - :attr:`implicit_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """simple. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any - ) -> None: - """simple. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_implicit_body_simple_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/implicitbody/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py index 2443804a4b4..b068e5f17f7 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/models/_models.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class User(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py similarity index 90% rename from packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py index c70354e72dc..e6d8ddd24ac 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/explicitbody/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/__init__.py @@ -13,6 +13,7 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import ExplicitBodyOperations # type: ignore +from ._operations import ImplicitBodyOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -20,6 +21,7 @@ __all__ = [ "ExplicitBodyOperations", + "ImplicitBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py similarity index 72% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py index b5546f194b3..ee879c1bebb 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_operations.py @@ -25,9 +25,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import NamingClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer +from .._configuration import BasicClientConfiguration +from .._model_base import SdkJSONEncoder +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -36,62 +36,63 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_Unset: Any = object() _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_client_model_client_request(**kwargs: Any) -> HttpRequest: +def build_explicit_body_simple_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/client/naming/model/client" + _url = "/parameters/basic/explicit-body/simple" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_client_model_language_request(**kwargs: Any) -> HttpRequest: +def build_implicit_body_simple_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL - _url = "/client/naming/model/language" + _url = "/parameters/basic/implicit-body/simple" # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -class ClientModelOperations: +class ExplicitBodyOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~client.naming.NamingClient`'s - :attr:`client_model` attribute. + :class:`~parameters.basic.BasicClient`'s + :attr:`explicit_body` attribute. """ def __init__(self, *args, **kwargs): input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: NamingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def client(self, body: _models.ClientModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. - :type body: ~client.naming.models.ClientModel + :type body: ~parameters.basic.models.User :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -101,8 +102,8 @@ def client(self, body: _models.ClientModel, *, content_type: str = "application/ """ @overload - def client(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: JSON @@ -115,8 +116,8 @@ def client(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def client(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """client. + def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: IO[bytes] @@ -129,13 +130,13 @@ def client(self, body: IO[bytes], *, content_type: str = "application/json", **k """ @distributed_trace - def client( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ClientModel, JSON, IO[bytes]], **kwargs: Any + def simple( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any ) -> None: - """client. + """simple. - :param body: Is one of the following types: ClientModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.ClientModel or JSON or IO[bytes] + :param body: Is one of the following types: User, JSON, IO[bytes] Required. + :type body: ~parameters.basic.models.User or JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -161,7 +162,7 @@ def client( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_client_model_client_request( + _request = build_explicit_body_simple_request( content_type=content_type, content=_content, headers=_headers, @@ -186,12 +187,30 @@ def client( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class ImplicitBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.basic.BasicClient`'s + :attr:`implicit_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BasicClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - def language(self, body: _models.PythonModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. + def simple(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. - :param body: Required. - :type body: ~client.naming.models.PythonModel + :keyword name: Required. + :paramtype name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -201,8 +220,8 @@ def language(self, body: _models.PythonModel, *, content_type: str = "applicatio """ @overload - def language(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. + def simple(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: JSON @@ -215,8 +234,8 @@ def language(self, body: JSON, *, content_type: str = "application/json", **kwar """ @overload - def language(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """language. + def simple(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """simple. :param body: Required. :type body: IO[bytes] @@ -229,13 +248,15 @@ def language(self, body: IO[bytes], *, content_type: str = "application/json", * """ @distributed_trace - def language( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.PythonModel, JSON, IO[bytes]], **kwargs: Any + def simple( # pylint: disable=inconsistent-return-statements + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any ) -> None: - """language. + """simple. - :param body: Is one of the following types: PythonModel, JSON, IO[bytes] Required. - :type body: ~client.naming.models.PythonModel or JSON or IO[bytes] + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -254,6 +275,11 @@ def language( # pylint: disable=inconsistent-return-statements content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -261,7 +287,7 @@ def language( # pylint: disable=inconsistent-return-statements else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_client_model_language_request( + _request = build_implicit_body_simple_request( content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-basic/parameters/basic/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py index 33530324be9..0e183074bb9 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from .._model_base import SdkJSONEncoder from .._serialization import Serializer from .._vendor import BodyOptionalityClientMixinABC @@ -73,7 +73,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -117,7 +117,7 @@ def required_explicit(self, body: IO[bytes], *, content_type: str = "application @distributed_trace def required_explicit( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.BodyModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """required_explicit. diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py index 4db2518d47a..ab625236008 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py @@ -24,7 +24,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._model_base import SdkJSONEncoder from ..._operations._operations import ( build_body_optionality_required_explicit_request, @@ -46,7 +46,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload async def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -91,7 +91,7 @@ async def required_explicit( """ @distributed_trace_async - async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def required_explicit(self, body: Union[_models2.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: """required_explicit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py index 301d6d6bfb8..1de50291f6c 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py @@ -24,7 +24,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import BodyOptionalityClientConfiguration @@ -58,7 +58,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -103,7 +103,7 @@ async def set( """ @distributed_trace_async - async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def set(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """set. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. @@ -163,7 +163,7 @@ async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = @overload async def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -208,7 +208,7 @@ async def omit( """ @distributed_trace_async - async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def omit(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """omit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py index dc8ff3c3b75..ed8d6706078 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py @@ -24,7 +24,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import BodyOptionalityClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -88,7 +88,7 @@ def __init__(self, *args, **kwargs): @overload def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -132,7 +132,7 @@ def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applicat @distributed_trace def set( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """set. @@ -193,7 +193,7 @@ def set( # pylint: disable=inconsistent-return-statements @overload def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -237,7 +237,7 @@ def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applica @distributed_trace def omit( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """omit. diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json b/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json index b55cf68f16a..4ba87f686fe 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/parameters-spread/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Parameters.Spread", "CrossLanguageDefinitionId": { - "parameters.spread.model.models.BodyParameter": "Parameters.Spread.Model.BodyParameter", + "parameters.spread.models.BodyParameter": "Parameters.Spread.Model.BodyParameter", "parameters.spread.SpreadClient.model.spread_as_request_body": "Parameters.Spread.Model.spreadAsRequestBody", "parameters.spread.SpreadClient.model.spread_composite_request_only_with_body": "Parameters.Spread.Model.spreadCompositeRequestOnlyWithBody", "parameters.spread.SpreadClient.model.spread_composite_request_without_body": "Parameters.Spread.Model.spreadCompositeRequestWithoutBody", diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py index 9f3ef36e2a7..a755936a900 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/_client.py @@ -16,8 +16,7 @@ from ._configuration import SpreadClientConfiguration from ._serialization import Deserializer, Serializer -from .alias.operations import AliasOperations -from .model.operations import ModelOperations +from .operations import AliasOperations, ModelOperations class SpreadClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py index a66fef5785d..5e74caef013 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/_client.py @@ -15,9 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..alias.aio.operations import AliasOperations -from ..model.aio.operations import ModelOperations from ._configuration import SpreadClientConfiguration +from .operations import AliasOperations, ModelOperations class SpreadClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py index 2131a6a0a16..f70348837ab 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ModelOperations # type: ignore from ._operations import AliasOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +20,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ModelOperations", "AliasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py index 440bb9a8358..8735d72abf0 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,16 +25,22 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import SpreadClientConfiguration +from ... import models as _models +from ..._model_base import SdkJSONEncoder +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_alias_spread_as_request_body_request, build_alias_spread_as_request_parameter_request, build_alias_spread_parameter_with_inner_alias_request, build_alias_spread_parameter_with_inner_model_request, build_alias_spread_with_multiple_parameters_request, + build_model_spread_as_request_body_request, + build_model_spread_composite_request_mix_request, + build_model_spread_composite_request_only_with_body_request, + build_model_spread_composite_request_request, + build_model_spread_composite_request_without_body_request, ) +from .._configuration import SpreadClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -45,6 +52,552 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +class ModelOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.spread.aio.SpreadClient`'s + :attr:`model` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_as_request_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_as_request_body. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_as_request_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_as_request_body. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def spread_as_request_body( + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """spread_as_request_body. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_as_request_body_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def spread_composite_request_only_with_body( + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request_only_with_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request_only_with_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def spread_composite_request_only_with_body( + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_only_with_body_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def spread_composite_request_without_body(self, name: str, *, test_header: str, **kwargs: Any) -> None: + """spread_composite_request_without_body. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_model_spread_composite_request_without_body_request( + name=name, + test_header=test_header, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def spread_composite_request( + self, + name: str, + body: _models.BodyParameter, + *, + test_header: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def spread_composite_request( + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_request( + name=name, + test_header=test_header, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def spread_composite_request_mix( + self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request_mix( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def spread_composite_request_mix( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def spread_composite_request_mix( + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if prop is _Unset: + raise TypeError("missing required argument: prop") + body = {"prop": prop} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_mix_request( + name=name, + test_header=test_header, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class AliasOperations: """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/model/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py deleted file mode 100644 index 1d2e89e2ccc..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py deleted file mode 100644 index d9bd6035ac0..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py +++ /dev/null @@ -1,592 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import SpreadClientConfiguration -from ...operations._operations import ( - build_model_spread_as_request_body_request, - build_model_spread_composite_request_mix_request, - build_model_spread_composite_request_only_with_body_request, - build_model_spread_composite_request_request, - build_model_spread_composite_request_without_body_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.spread.aio.SpreadClient`'s - :attr:`model` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_as_request_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_as_request_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_as_request_body( - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_as_request_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_only_with_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_only_with_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request_only_with_body( - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_only_with_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def spread_composite_request_without_body(self, name: str, *, test_header: str, **kwargs: Any) -> None: - """spread_composite_request_without_body. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_spread_composite_request_without_body_request( - name=name, - test_header=test_header, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request( - self, - name: str, - body: _models.BodyParameter, - *, - test_header: str, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request( - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def spread_composite_request_mix( - self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_mix( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def spread_composite_request_mix( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def spread_composite_request_mix( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if prop is _Unset: - raise TypeError("missing required argument: prop") - body = {"prop": prop} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_mix_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py deleted file mode 100644 index 1d2e89e2ccc..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py deleted file mode 100644 index 34604c246ec..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_operations.py +++ /dev/null @@ -1,679 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import SpreadClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_model_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/request-body" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_only_with_body_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request-only-with-body" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_without_body_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/parameters/spread/model/composite-request-without-body/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_model_spread_composite_request_mix_request( # pylint: disable=name-too-long - name: str, *, test_header: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/parameters/spread/model/composite-request-mix/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -class ModelOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.spread.SpreadClient`'s - :attr:`model` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :keyword name: Required. - :paramtype name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_as_request_body(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_as_request_body(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """spread_as_request_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_as_request_body( # pylint: disable=inconsistent-return-statements - self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any - ) -> None: - """spread_as_request_body. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword name: Required. - :paramtype name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if name is _Unset: - raise TypeError("missing required argument: name") - body = {"name": name} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_as_request_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_only_with_body( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_only_with_body( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """spread_composite_request_only_with_body. - - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_only_with_body_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def spread_composite_request_without_body( # pylint: disable=inconsistent-return-statements - self, name: str, *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request_without_body. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_model_spread_composite_request_without_body_request( - name=name, - test_header=test_header, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request( - self, - name: str, - body: _models.BodyParameter, - *, - test_header: str, - content_type: str = "application/json", - **kwargs: Any, - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: ~parameters.spread.models.BodyParameter - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any - ) -> None: - """spread_composite_request. - - :param name: Required. - :type name: str - :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. - :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def spread_composite_request_mix( - self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_mix( - self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: JSON - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def spread_composite_request_mix( - self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Required. - :type body: IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def spread_composite_request_mix( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any - ) -> None: - """spread_composite_request_mix. - - :param name: Required. - :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword test_header: Required. - :paramtype test_header: str - :keyword prop: Required. - :paramtype prop: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - if body is _Unset: - if prop is _Unset: - raise TypeError("missing required argument: prop") - body = {"prop": prop} - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_spread_composite_request_mix_request( - name=name, - test_header=test_header, - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py index 53c260193e2..bce4236681e 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/model/models/_models.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class BodyParameter(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/model/models/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py similarity index 92% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py index 2131a6a0a16..f70348837ab 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ModelOperations # type: ignore from ._operations import AliasOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +20,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ModelOperations", "AliasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py similarity index 57% rename from packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py index cd72b3b07b5..87b43ee0b46 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/alias/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,9 +25,10 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ..._configuration import SpreadClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer +from .. import models as _models +from .._configuration import SpreadClientConfiguration +from .._model_base import SdkJSONEncoder +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -41,6 +43,99 @@ _SERIALIZER.client_side_validation = False +def build_model_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/spread/model/request-body" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_model_spread_composite_request_only_with_body_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/spread/model/composite-request-only-with-body" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_model_spread_composite_request_without_body_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/parameters/spread/model/composite-request-without-body/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_model_spread_composite_request_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/spread/model/composite-request/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_model_spread_composite_request_mix_request( # pylint: disable=name-too-long + name: str, *, test_header: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/parameters/spread/model/composite-request-mix/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["test-header"] = _SERIALIZER.header("test_header", test_header, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + def build_alias_spread_as_request_body_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -143,6 +238,550 @@ def build_alias_spread_parameter_with_inner_alias_request( # pylint: disable=na return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +class ModelOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~parameters.spread.SpreadClient`'s + :attr:`model` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpreadClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def spread_as_request_body(self, *, name: str, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. + + :keyword name: Required. + :paramtype name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_as_request_body(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_as_request_body(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """spread_as_request_body. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def spread_as_request_body( # pylint: disable=inconsistent-return-statements + self, body: Union[JSON, IO[bytes]] = _Unset, *, name: str = _Unset, **kwargs: Any + ) -> None: + """spread_as_request_body. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword name: Required. + :paramtype name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if name is _Unset: + raise TypeError("missing required argument: name") + body = {"name": name} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_as_request_body_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def spread_composite_request_only_with_body( + self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request_only_with_body( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request_only_with_body( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """spread_composite_request_only_with_body. + + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_only_with_body_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def spread_composite_request_without_body( # pylint: disable=inconsistent-return-statements + self, name: str, *, test_header: str, **kwargs: Any + ) -> None: + """spread_composite_request_without_body. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_model_spread_composite_request_without_body_request( + name=name, + test_header=test_header, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def spread_composite_request( + self, + name: str, + body: _models.BodyParameter, + *, + test_header: str, + content_type: str = "application/json", + **kwargs: Any, + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: ~parameters.spread.models.BodyParameter + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def spread_composite_request( # pylint: disable=inconsistent-return-statements + self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + ) -> None: + """spread_composite_request. + + :param name: Required. + :type name: str + :param body: Is one of the following types: BodyParameter, JSON, IO[bytes] Required. + :type body: ~parameters.spread.models.BodyParameter or JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_request( + name=name, + test_header=test_header, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def spread_composite_request_mix( + self, name: str, *, test_header: str, prop: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request_mix( + self, name: str, body: JSON, *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def spread_composite_request_mix( + self, name: str, body: IO[bytes], *, test_header: str, content_type: str = "application/json", **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def spread_composite_request_mix( # pylint: disable=inconsistent-return-statements + self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, test_header: str, prop: str = _Unset, **kwargs: Any + ) -> None: + """spread_composite_request_mix. + + :param name: Required. + :type name: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword test_header: Required. + :paramtype test_header: str + :keyword prop: Required. + :paramtype prop: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + if body is _Unset: + if prop is _Unset: + raise TypeError("missing required argument: prop") + body = {"prop": prop} + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_spread_composite_request_mix_request( + name=name, + test_header=test_header, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class AliasOperations: """ .. warning:: @@ -335,7 +974,7 @@ def spread_parameter_with_inner_model( # pylint: disable=inconsistent-return-st *, x_ms_test_header: str, name: str = _Unset, - **kwargs: Any + **kwargs: Any, ) -> None: """spread_parameter_with_inner_model. @@ -472,7 +1111,7 @@ def spread_as_request_parameter( # pylint: disable=inconsistent-return-statemen *, x_ms_test_header: str, name: str = _Unset, - **kwargs: Any + **kwargs: Any, ) -> None: """spread_as_request_parameter. @@ -552,7 +1191,7 @@ def spread_with_multiple_parameters( content_type: str = "application/json", optional_int: Optional[int] = None, optional_string_list: Optional[List[str]] = None, - **kwargs: Any + **kwargs: Any, ) -> None: """spread_with_multiple_parameters. @@ -627,7 +1266,7 @@ def spread_with_multiple_parameters( # pylint: disable=inconsistent-return-stat required_int_list: List[int] = _Unset, optional_int: Optional[int] = None, optional_string_list: Optional[List[str]] = None, - **kwargs: Any + **kwargs: Any, ) -> None: """spread_with_multiple_parameters. @@ -718,7 +1357,7 @@ def spread_parameter_with_inner_alias( name: str, age: int, content_type: str = "application/json", - **kwargs: Any + **kwargs: Any, ) -> None: """spread an alias with contains another alias property as body. @@ -787,7 +1426,7 @@ def spread_parameter_with_inner_alias( # pylint: disable=inconsistent-return-st x_ms_test_header: str, name: str = _Unset, age: int = _Unset, - **kwargs: Any + **kwargs: Any, ) -> None: """spread an alias with contains another alias property as body. diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_patch.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/model/operations/_patch.py rename to packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json b/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json index c04d68a8994..7413f1ac33a 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Payload.ContentNegotiation", "CrossLanguageDefinitionId": { - "payload.contentnegotiation.differentbody.models.PngImageAsJson": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", + "payload.contentnegotiation.models.PngImageAsJson": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", "payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_png": "Payload.ContentNegotiation.SameBody.getAvatarAsPng", "payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_jpeg": "Payload.ContentNegotiation.SameBody.getAvatarAsJpeg", "payload.contentnegotiation.ContentNegotiationClient.different_body.get_avatar_as_png": "Payload.ContentNegotiation.DifferentBody.getAvatarAsPng", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py index ece09d7e4aa..1fbdbf69230 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/_client.py @@ -16,8 +16,7 @@ from ._configuration import ContentNegotiationClientConfiguration from ._serialization import Deserializer, Serializer -from .differentbody.operations import DifferentBodyOperations -from .samebody.operations import SameBodyOperations +from .operations import DifferentBodyOperations, SameBodyOperations class ContentNegotiationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py index 56c21f43cd9..88fb495e0c1 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/_client.py @@ -15,9 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..differentbody.aio.operations import DifferentBodyOperations -from ..samebody.aio.operations import SameBodyOperations from ._configuration import ContentNegotiationClientConfiguration +from .operations import DifferentBodyOperations, SameBodyOperations class ContentNegotiationClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py similarity index 91% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py index 252469fdbe3..1368193a3d3 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import SameBodyOperations # type: ignore from ._operations import DifferentBodyOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +20,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "SameBodyOperations", "DifferentBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py similarity index 55% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py index 424599a5979..78df2b590bb 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py @@ -25,13 +25,15 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import ContentNegotiationClientConfiguration +from ..._model_base import _deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_different_body_get_avatar_as_json_request, build_different_body_get_avatar_as_png_request, + build_same_body_get_avatar_as_jpeg_request, + build_same_body_get_avatar_as_png_request, ) +from .._configuration import ContentNegotiationClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -41,6 +43,140 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +class SameBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s + :attr:`same_body` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: + """get_avatar_as_png. + + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: + """get_avatar_as_jpeg. + + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_jpeg_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class DifferentBodyOperations: """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/property/models/_patch.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py similarity index 94% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py index 6a3df60df29..872fb18c037 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/models/_models.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class PngImageAsJson(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py similarity index 91% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py index 252469fdbe3..1368193a3d3 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import SameBodyOperations # type: ignore from ._operations import DifferentBodyOperations # type: ignore from ._patch import __all__ as _patch_all @@ -19,6 +20,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "SameBodyOperations", "DifferentBodyOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py similarity index 55% rename from packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py index 22844d8363a..0db304fee4f 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py @@ -25,9 +25,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import ContentNegotiationClientConfiguration -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer +from .._configuration import ContentNegotiationClientConfiguration +from .._model_base import _deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -40,6 +40,32 @@ _SERIALIZER.client_side_validation = False +def build_same_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + # Construct URL + _url = "/content-negotiation/same-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_same_body_get_avatar_as_jpeg_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + # Construct URL + _url = "/content-negotiation/same-body" + + # Construct headers + _headers["accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + def build_different_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -66,6 +92,140 @@ def build_different_body_get_avatar_as_json_request(**kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) +class SameBodyOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.contentnegotiation.ContentNegotiationClient`'s + :attr:`same_body` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: + """get_avatar_as_png. + + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_png_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: + """get_avatar_as_jpeg. + + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_same_body_get_avatar_as_jpeg_request( + accept=accept, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class DifferentBodyOperations: """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/models/_patch.py rename to packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py deleted file mode 100644 index 7254e3c3b6e..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import SameBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SameBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py deleted file mode 100644 index 6d65afe55c1..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_operations.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import ContentNegotiationClientConfiguration -from ...operations._operations import ( - build_same_body_get_avatar_as_jpeg_request, - build_same_body_get_avatar_as_png_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SameBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.contentnegotiation.aio.ContentNegotiationClient`'s - :attr:`same_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: - """get_avatar_as_png. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_same_body_get_avatar_as_png_request( - accept=accept, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: - """get_avatar_as_jpeg. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_same_body_get_avatar_as_jpeg_request( - accept=accept, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py deleted file mode 100644 index 7254e3c3b6e..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import SameBodyOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SameBodyOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py deleted file mode 100644 index 5a07e7a2957..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_operations.py +++ /dev/null @@ -1,198 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from ..._configuration import ContentNegotiationClientConfiguration -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_same_body_get_avatar_as_png_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) - # Construct URL - _url = "/content-negotiation/same-body" - - # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_same_body_get_avatar_as_jpeg_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) - # Construct URL - _url = "/content-negotiation/same-body" - - # Construct headers - _headers["accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -class SameBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.contentnegotiation.ContentNegotiationClient`'s - :attr:`same_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContentNegotiationClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: - """get_avatar_as_png. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - accept: Literal["image/png"] = kwargs.pop("accept", _headers.pop("accept", "image/png")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_same_body_get_avatar_as_png_request( - accept=accept, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: - """get_avatar_as_jpeg. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - accept: Literal["image/jpeg"] = kwargs.pop("accept", _headers.pop("accept", "image/jpeg")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_same_body_get_avatar_as_jpeg_request( - accept=accept, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/samebody/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json index 86a58605c50..01e6180bb23 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json @@ -8,7 +8,7 @@ "payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest": "Payload.MultiPart.FileWithHttpPartOptionalContentTypeRequest", "payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest", "payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest", - "payload.multipart.formdata.httpparts.nonstring.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", + "payload.multipart.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", "payload.multipart.models.JsonPartRequest": "Payload.MultiPart.JsonPartRequest", "payload.multipart.models.MultiBinaryPartsRequest": "Payload.MultiPart.MultiBinaryPartsRequest", "payload.multipart.models.MultiPartRequest": "Payload.MultiPart.MultiPartRequest", diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py index a8091bbba72..f671b5edf94 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/_client.py @@ -16,7 +16,7 @@ from ._configuration import MultiPartClientConfiguration from ._serialization import Deserializer, Serializer -from .formdata.operations import FormDataOperations +from .operations import FormDataOperations class MultiPartClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py index cf06ea8e258..5d8c9a57dd3 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..formdata.aio.operations import FormDataOperations from ._configuration import MultiPartClientConfiguration +from .operations import FormDataOperations class MultiPartClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py similarity index 55% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py index 1bd7db3b544..b0dfe05e146 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -21,20 +22,24 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from .... import _model_base, models as _models -from ...._serialization import Deserializer, Serializer -from ...._vendor import FileType, prepare_multipart_form_data -from ....aio._configuration import MultiPartClientConfiguration -from ...httpparts.aio.operations._operations import FormDataHttpPartsOperations +from ... import _model_base, models as _models +from ..._serialization import Deserializer, Serializer +from ..._vendor import FileType, prepare_multipart_form_data from ...operations._operations import ( build_form_data_anonymous_model_request, build_form_data_basic_request, build_form_data_binary_array_parts_request, build_form_data_check_file_name_and_content_type_request, build_form_data_file_array_and_basic_request, + build_form_data_http_parts_content_type_image_jpeg_content_type_request, + build_form_data_http_parts_content_type_optional_content_type_request, + build_form_data_http_parts_content_type_required_content_type_request, + build_form_data_http_parts_json_array_and_file_array_request, + build_form_data_http_parts_non_string_float_request, build_form_data_json_part_request, build_form_data_multi_binary_parts_request, ) +from .._configuration import MultiPartClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -598,3 +603,456 @@ async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType if cls: return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def json_array_and_file_array( + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def image_jpeg_content_type( + self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def image_jpeg_content_type( + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def required_content_type( + self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def required_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def required_content_type( + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_required_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def optional_content_type( + self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def optional_content_type( + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_optional_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: ~payload.multipart.models.FloatRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def float(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_non_string_float_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-naming/client/naming/unionenum/operations/_patch.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py deleted file mode 100644 index 0097d2250a1..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ..... import _model_base, models as _models -from ....._serialization import Deserializer, Serializer -from ....._vendor import prepare_multipart_form_data -from .....aio._configuration import MultiPartClientConfiguration -from ...contenttype.aio.operations._operations import FormDataHttpPartsContentTypeOperations -from ...nonstring.aio.operations._operations import FormDataHttpPartsNonStringOperations -from ...operations._operations import build_form_data_http_parts_json_array_and_file_array_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class FormDataHttpPartsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`http_parts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.content_type = FormDataHttpPartsContentTypeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.non_string = FormDataHttpPartsNonStringOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @overload - async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def json_array_and_file_array( - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_json_array_and_file_array_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py deleted file mode 100644 index 1dec8f9e50c..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py +++ /dev/null @@ -1,298 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...... import _model_base, models as _models -from ......_serialization import Deserializer, Serializer -from ......_vendor import prepare_multipart_form_data -from ......aio._configuration import MultiPartClientConfiguration -from ...operations._operations import ( - build_form_data_http_parts_content_type_image_jpeg_content_type_request, - build_form_data_http_parts_content_type_optional_content_type_request, - build_form_data_http_parts_content_type_required_content_type_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class FormDataHttpPartsContentTypeOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`content_type` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def image_jpeg_content_type( - self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def image_jpeg_content_type( - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def required_content_type( - self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def required_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def required_content_type( - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_required_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def optional_content_type( - self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def optional_content_type( - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_optional_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py deleted file mode 100644 index 0f68f35f7b9..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py +++ /dev/null @@ -1,324 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from ..... import _model_base, models as _models -from ....._configuration import MultiPartClientConfiguration -from ....._serialization import Deserializer, Serializer -from ....._vendor import prepare_multipart_form_data - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/check-filename-and-specific-content-type-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/check-filename-and-required-content-type-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/file-with-http-part-optional-content-type" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class FormDataHttpPartsContentTypeOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`content_type` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def required_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def required_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data. - - :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_required_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def optional_content_type(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def optional_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for optional content type. - - :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. - Required. - :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage"] - _data_fields: List[str] = [] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_content_type_optional_content_type_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py deleted file mode 100644 index 2d98c5305b8..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async - -from ... import models as _models -from ...... import _model_base -from ......_serialization import Deserializer, Serializer -from ......_vendor import prepare_multipart_form_data -from ......aio._configuration import MultiPartClientConfiguration -from ...operations._operations import build_form_data_http_parts_non_string_float_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class FormDataHttpPartsNonStringOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.aio.MultiPartClient`'s - :attr:`non_string` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: ~payload.multipart.models.FloatRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def float(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Is either a FloatRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.FloatRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = [] - _data_fields: List[str] = ["temperature"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_non_string_float_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py deleted file mode 100644 index e16e485d421..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - FloatRequest, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "FloatRequest", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py deleted file mode 100644 index 368bfebfef2..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_models.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ..... import _model_base -from ....._model_base import rest_field - - -class FloatRequest(_model_base.Model): - """FloatRequest. - - :ivar temperature: Required. - :vartype temperature: float - """ - - temperature: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - temperature: float, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py deleted file mode 100644 index 6a2fd172685..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..... import _model_base -from ....._configuration import MultiPartClientConfiguration -from ....._serialization import Deserializer, Serializer -from ....._vendor import prepare_multipart_form_data - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/non-string-float" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class FormDataHttpPartsNonStringOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`non_string` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: ~payload.multipart.models.FloatRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def float(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def float( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FloatRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for non string. - - :param body: Is either a FloatRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.FloatRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = [] - _data_fields: List[str] = ["temperature"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_non_string_float_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py deleted file mode 100644 index 933fcd7d1b5..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py deleted file mode 100644 index ba5ff606963..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .... import _model_base, models as _models -from ...._configuration import MultiPartClientConfiguration -from ...._serialization import Deserializer, Serializer -from ...._vendor import prepare_multipart_form_data -from ..contenttype.operations._operations import FormDataHttpPartsContentTypeOperations -from ..nonstring.operations._operations import FormDataHttpPartsNonStringOperations - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/multipart/form-data/complex-parts-with-httppart" - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class FormDataHttpPartsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.multipart.MultiPartClient`'s - :attr:`http_parts` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.content_type = FormDataHttpPartsContentTypeOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.non_string = FormDataHttpPartsNonStringOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @overload - def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Required. - :type body: JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def json_array_and_file_array( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. - - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] - _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - - _request = build_form_data_http_parts_json_array_and_file_array_request( - files=_files, - data=_data, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py index 9533076c687..46cfc048f65 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py @@ -21,6 +21,7 @@ FileWithHttpPartOptionalContentTypeRequest, FileWithHttpPartRequiredContentTypeRequest, FileWithHttpPartSpecificContentTypeRequest, + FloatRequest, JsonPartRequest, MultiBinaryPartsRequest, MultiPartRequest, @@ -37,6 +38,7 @@ "FileWithHttpPartOptionalContentTypeRequest", "FileWithHttpPartRequiredContentTypeRequest", "FileWithHttpPartSpecificContentTypeRequest", + "FloatRequest", "JsonPartRequest", "MultiBinaryPartsRequest", "MultiPartRequest", diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py index e09cb4ea0d4..ce3efa2d35e 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py @@ -271,6 +271,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class FloatRequest(_model_base.Model): + """FloatRequest. + + :ivar temperature: Required. + :vartype temperature: float + """ + + temperature: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + temperature: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class JsonPartRequest(_model_base.Model): """JsonPartRequest. diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/__init__.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py similarity index 56% rename from packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py index 29d9b4b0354..138e8d8a73b 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -22,11 +23,10 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ... import _model_base, models as _models -from ..._configuration import MultiPartClientConfiguration -from ..._serialization import Deserializer, Serializer -from ..._vendor import FileType, prepare_multipart_form_data -from ..httpparts.operations._operations import FormDataHttpPartsOperations +from .. import _model_base, models as _models +from .._configuration import MultiPartClientConfiguration +from .._serialization import Deserializer, Serializer +from .._vendor import FileType, prepare_multipart_form_data if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -106,6 +106,59 @@ def build_form_data_anonymous_model_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/complex-parts-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/check-filename-and-specific-content-type-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/check-filename-and-required-content-type-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/file-with-http-part-optional-content-type" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/non-string-float" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + class FormDataOperations: """ .. warning:: @@ -670,3 +723,452 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartSpecificContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def required_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def required_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data. + + :param body: Is either a FileWithHttpPartRequiredContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_required_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def optional_content_type(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def optional_content_type( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for optional content type. + + :param body: Is either a FileWithHttpPartOptionalContentTypeRequest type or a JSON type. + Required. + :type body: ~payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_content_type_optional_content_type_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: MultiPartClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: ~payload.multipart.models.FloatRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def float(self, body: JSON, **kwargs: Any) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for non string. + + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_non_string_float_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py index ee891749177..3519ce73663 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -22,7 +22,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace -from .... import models as _models +from .... import models as _models3 from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import PageableClientConfiguration @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: ) @distributed_trace - def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: + def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: """link. :return: An iterator like instance of Pet @@ -69,7 +69,7 @@ def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -106,7 +106,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index aaf4e07ffba..04c63181322 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -22,7 +22,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace -from ..... import models as _models +from ..... import models as _models4 from ....._model_base import _deserialize from ....._serialization import Deserializer, Serializer from .....aio._configuration import PageableClientConfiguration @@ -60,12 +60,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def request_query_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_query_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -77,7 +75,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -87,43 +85,30 @@ def request_query_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -141,12 +126,10 @@ async def get_next(next_link=None): @distributed_trace def request_header_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_header_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -158,7 +141,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -168,43 +151,30 @@ def request_header_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -222,12 +192,10 @@ async def get_next(next_link=None): @distributed_trace def request_query_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_query_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -239,7 +207,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -249,43 +217,30 @@ def request_query_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -303,12 +258,10 @@ async def get_next(next_link=None): @distributed_trace def request_header_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_header_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -320,7 +273,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -330,43 +283,30 @@ def request_header_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 0077c898289..ee4803f0993 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -24,7 +24,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._configuration import PageableClientConfiguration from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer @@ -159,12 +159,10 @@ def __init__(self, *args, **kwargs): @distributed_trace def request_query_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_query_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -176,7 +174,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -186,43 +184,30 @@ def request_query_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("nextToken") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -240,12 +225,10 @@ def get_next(next_link=None): @distributed_trace def request_header_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_header_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -257,7 +240,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -267,43 +250,30 @@ def request_header_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("nextToken") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -321,12 +291,10 @@ def get_next(next_link=None): @distributed_trace def request_query_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_query_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -338,7 +306,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -348,43 +316,30 @@ def request_query_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -402,12 +357,10 @@ def get_next(next_link=None): @distributed_trace def request_header_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_header_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -419,7 +372,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -429,43 +382,30 @@ def request_header_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(_continuation_token=None): + _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py index 5a0ccb0581e..aa7026c01c1 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -23,7 +23,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import PageableClientConfiguration from ..._model_base import _deserialize from ..._serialization import Deserializer, Serializer @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs): ) @distributed_trace - def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: + def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: """link. :return: An iterator like instance of Pet @@ -86,7 +86,7 @@ def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models2.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -123,7 +123,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models2.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json index 16ba9487d60..cd41bacf9ac 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Serialization.EncodedName.Json", "CrossLanguageDefinitionId": { - "serialization.encodedname.json.property.models.JsonEncodedNameModel": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", + "serialization.encodedname.json.models.JsonEncodedNameModel": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", "serialization.encodedname.json.JsonClient.property.send": "Serialization.EncodedName.Json.Property.send", "serialization.encodedname.json.JsonClient.property.get": "Serialization.EncodedName.Json.Property.get" } diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py index 62a9bcf2a27..3fb191aaf4f 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/_client.py @@ -16,7 +16,7 @@ from ._configuration import JsonClientConfiguration from ._serialization import Deserializer, Serializer -from .property.operations import PropertyOperations +from .operations import PropertyOperations class JsonClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py index f088234847b..560d2f21056 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..property.aio.operations import PropertyOperations from ._configuration import JsonClientConfiguration +from .operations import PropertyOperations class JsonClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py similarity index 97% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py index 1e8a6208b73..2d0183eece1 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py @@ -27,10 +27,10 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ...._model_base import SdkJSONEncoder, _deserialize -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import JsonClientConfiguration +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import build_property_get_request, build_property_send_request +from .._configuration import JsonClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/baz/operations/_patch.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/__init__.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py similarity index 95% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py index 0c3275c7389..ee9a4c7d00a 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_models.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class JsonEncodedNameModel(_model_base.Model): diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/property/operations/__init__.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py index c1dbf782b27..81595014e1c 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py @@ -27,9 +27,9 @@ from azure.core.utils import case_insensitive_dict from .. import models as _models -from ..._configuration import JsonClientConfiguration -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer +from .._configuration import JsonClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/qux/operations/_patch.py rename to packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json b/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json index ee042fc9299..0e31f4ac4f0 100644 --- a/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/special-words/apiview-properties.json @@ -1,40 +1,40 @@ { "CrossLanguagePackageId": "SpecialWords", "CrossLanguageDefinitionId": { - "specialwords.models.models.AndModel": "SpecialWords.Models.and", - "specialwords.models.models.AsModel": "SpecialWords.Models.as", - "specialwords.models.models.AssertModel": "SpecialWords.Models.assert", - "specialwords.models.models.AsyncModel": "SpecialWords.Models.async", - "specialwords.models.models.AwaitModel": "SpecialWords.Models.await", - "specialwords.models.models.BreakModel": "SpecialWords.Models.break", - "specialwords.models.models.ClassModel": "SpecialWords.Models.class", - "specialwords.models.models.Constructor": "SpecialWords.Models.constructor", - "specialwords.models.models.ContinueModel": "SpecialWords.Models.continue", - "specialwords.models.models.DefModel": "SpecialWords.Models.def", - "specialwords.models.models.DelModel": "SpecialWords.Models.del", - "specialwords.models.models.ElifModel": "SpecialWords.Models.elif", - "specialwords.models.models.ElseModel": "SpecialWords.Models.else", - "specialwords.models.models.ExceptModel": "SpecialWords.Models.except", - "specialwords.models.models.ExecModel": "SpecialWords.Models.exec", - "specialwords.models.models.FinallyModel": "SpecialWords.Models.finally", - "specialwords.models.models.ForModel": "SpecialWords.Models.for", - "specialwords.models.models.FromModel": "SpecialWords.Models.from", - "specialwords.models.models.GlobalModel": "SpecialWords.Models.global", - "specialwords.models.models.IfModel": "SpecialWords.Models.if", - "specialwords.models.models.ImportModel": "SpecialWords.Models.import", - "specialwords.models.models.InModel": "SpecialWords.Models.in", - "specialwords.models.models.IsModel": "SpecialWords.Models.is", - "specialwords.models.models.LambdaModel": "SpecialWords.Models.lambda", - "specialwords.models.models.NotModel": "SpecialWords.Models.not", - "specialwords.models.models.OrModel": "SpecialWords.Models.or", - "specialwords.models.models.PassModel": "SpecialWords.Models.pass", - "specialwords.models.models.RaiseModel": "SpecialWords.Models.raise", - "specialwords.models.models.ReturnModel": "SpecialWords.Models.return", - "specialwords.modelproperties.models.SameAsModel": "SpecialWords.ModelProperties.SameAsModel", - "specialwords.models.models.TryModel": "SpecialWords.Models.try", - "specialwords.models.models.WhileModel": "SpecialWords.Models.while", - "specialwords.models.models.WithModel": "SpecialWords.Models.with", - "specialwords.models.models.YieldModel": "SpecialWords.Models.yield", + "specialwords.models.AndModel": "SpecialWords.Models.and", + "specialwords.models.AsModel": "SpecialWords.Models.as", + "specialwords.models.AssertModel": "SpecialWords.Models.assert", + "specialwords.models.AsyncModel": "SpecialWords.Models.async", + "specialwords.models.AwaitModel": "SpecialWords.Models.await", + "specialwords.models.BreakModel": "SpecialWords.Models.break", + "specialwords.models.ClassModel": "SpecialWords.Models.class", + "specialwords.models.Constructor": "SpecialWords.Models.constructor", + "specialwords.models.ContinueModel": "SpecialWords.Models.continue", + "specialwords.models.DefModel": "SpecialWords.Models.def", + "specialwords.models.DelModel": "SpecialWords.Models.del", + "specialwords.models.ElifModel": "SpecialWords.Models.elif", + "specialwords.models.ElseModel": "SpecialWords.Models.else", + "specialwords.models.ExceptModel": "SpecialWords.Models.except", + "specialwords.models.ExecModel": "SpecialWords.Models.exec", + "specialwords.models.FinallyModel": "SpecialWords.Models.finally", + "specialwords.models.ForModel": "SpecialWords.Models.for", + "specialwords.models.FromModel": "SpecialWords.Models.from", + "specialwords.models.GlobalModel": "SpecialWords.Models.global", + "specialwords.models.IfModel": "SpecialWords.Models.if", + "specialwords.models.ImportModel": "SpecialWords.Models.import", + "specialwords.models.InModel": "SpecialWords.Models.in", + "specialwords.models.IsModel": "SpecialWords.Models.is", + "specialwords.models.LambdaModel": "SpecialWords.Models.lambda", + "specialwords.models.NotModel": "SpecialWords.Models.not", + "specialwords.models.OrModel": "SpecialWords.Models.or", + "specialwords.models.PassModel": "SpecialWords.Models.pass", + "specialwords.models.RaiseModel": "SpecialWords.Models.raise", + "specialwords.models.ReturnModel": "SpecialWords.Models.return", + "specialwords.models.SameAsModel": "SpecialWords.ModelProperties.SameAsModel", + "specialwords.models.TryModel": "SpecialWords.Models.try", + "specialwords.models.WhileModel": "SpecialWords.Models.while", + "specialwords.models.WithModel": "SpecialWords.Models.with", + "specialwords.models.YieldModel": "SpecialWords.Models.yield", "specialwords.SpecialWordsClient.models.with_and": "SpecialWords.Models.withAnd", "specialwords.SpecialWordsClient.models.with_as": "SpecialWords.Models.withAs", "specialwords.SpecialWordsClient.models.with_assert": "SpecialWords.Models.withAssert", diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py index 41b05891176..e999f31bbec 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/_client.py @@ -16,9 +16,7 @@ from ._configuration import SpecialWordsClientConfiguration from ._serialization import Deserializer, Serializer -from .modelproperties.operations import ModelPropertiesOperations -from .models.operations import ModelsOperations -from .operations import Operations, ParametersOperations +from .operations import ModelPropertiesOperations, ModelsOperations, Operations, ParametersOperations class SpecialWordsClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py index 7f246800020..4d9f8a5e9f4 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/_client.py @@ -15,10 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..modelproperties.aio.operations import ModelPropertiesOperations -from ..models.aio.operations import ModelsOperations from ._configuration import SpecialWordsClientConfiguration -from .operations import Operations, ParametersOperations +from .operations import ModelPropertiesOperations, ModelsOperations, Operations, ParametersOperations class SpecialWordsClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py index 05cd579e07d..b4802a9d551 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ModelsOperations # type: ignore +from ._operations import ModelPropertiesOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ParametersOperations # type: ignore @@ -20,6 +22,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ModelsOperations", + "ModelPropertiesOperations", "Operations", "ParametersOperations", ] diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py index e8343dfd4bb..ab6664afc82 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py @@ -6,8 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase +import json import sys -from typing import Any, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -21,9 +23,46 @@ from azure.core.pipeline import PipelineResponse from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from ... import models as _models +from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer from ...operations._operations import ( + build_model_properties_same_as_model_request, + build_models_with_and_request, + build_models_with_as_request, + build_models_with_assert_request, + build_models_with_async_request, + build_models_with_await_request, + build_models_with_break_request, + build_models_with_class_request, + build_models_with_constructor_request, + build_models_with_continue_request, + build_models_with_def_request, + build_models_with_del_request, + build_models_with_elif_request, + build_models_with_else_request, + build_models_with_except_request, + build_models_with_exec_request, + build_models_with_finally_request, + build_models_with_for_request, + build_models_with_from_request, + build_models_with_global_request, + build_models_with_if_request, + build_models_with_import_request, + build_models_with_in_request, + build_models_with_is_request, + build_models_with_lambda_request, + build_models_with_not_request, + build_models_with_or_request, + build_models_with_pass_request, + build_models_with_raise_request, + build_models_with_return_request, + build_models_with_try_request, + build_models_with_while_request, + build_models_with_with_request, + build_models_with_yield_request, build_operations_and_method_request, build_operations_as_method_request, build_operations_assert_method_request, @@ -98,10 +137,3425 @@ from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +class ModelsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.aio.SpecialWordsClient`'s + :attr:`models` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: ~specialwords.models.AndModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_and. + + :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AndModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_and_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: ~specialwords.models.AsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_as. + + :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_as_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_assert( + self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_assert. + + :param body: Required. + :type body: ~specialwords.models.AssertModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_assert. + + :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_assert_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_async( + self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_async. + + :param body: Required. + :type body: ~specialwords.models.AsyncModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_async. + + :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_async_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_await( + self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_await. + + :param body: Required. + :type body: ~specialwords.models.AwaitModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_await. + + :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_await_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_break( + self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_break. + + :param body: Required. + :type body: ~specialwords.models.BreakModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_break. + + :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_break_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_class( + self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_class. + + :param body: Required. + :type body: ~specialwords.models.ClassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_class. + + :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_class_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_constructor( + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Required. + :type body: ~specialwords.models.Constructor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_constructor. + + :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. + :type body: ~specialwords.models.Constructor or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_constructor_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_continue( + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_continue. + + :param body: Required. + :type body: ~specialwords.models.ContinueModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_continue. + + :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_continue_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: ~specialwords.models.DefModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_def. + + :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DefModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_def_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: ~specialwords.models.DelModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_del. + + :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DelModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_del_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_elif( + self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_elif. + + :param body: Required. + :type body: ~specialwords.models.ElifModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_elif. + + :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_elif_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_else( + self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_else. + + :param body: Required. + :type body: ~specialwords.models.ElseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_else. + + :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_else_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_except( + self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_except. + + :param body: Required. + :type body: ~specialwords.models.ExceptModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_except. + + :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_except_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_exec( + self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_exec. + + :param body: Required. + :type body: ~specialwords.models.ExecModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_exec. + + :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_exec_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_finally( + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_finally. + + :param body: Required. + :type body: ~specialwords.models.FinallyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_finally. + + :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_finally_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: ~specialwords.models.ForModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_for. + + :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ForModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_for_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_from( + self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_from. + + :param body: Required. + :type body: ~specialwords.models.FromModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_from. + + :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FromModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_from_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_global( + self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_global. + + :param body: Required. + :type body: ~specialwords.models.GlobalModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_global. + + :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_global_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: ~specialwords.models.IfModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_if. + + :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IfModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_if_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_import( + self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_import. + + :param body: Required. + :type body: ~specialwords.models.ImportModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_import. + + :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_import_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: ~specialwords.models.InModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_in. + + :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.InModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_in_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: ~specialwords.models.IsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_is. + + :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_is_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_lambda( + self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_lambda. + + :param body: Required. + :type body: ~specialwords.models.LambdaModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_lambda. + + :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_lambda_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: ~specialwords.models.NotModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_not. + + :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.NotModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_not_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: ~specialwords.models.OrModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_or. + + :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.OrModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_or_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_pass( + self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_pass. + + :param body: Required. + :type body: ~specialwords.models.PassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_pass. + + :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.PassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_pass_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_raise( + self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_raise. + + :param body: Required. + :type body: ~specialwords.models.RaiseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_raise. + + :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_raise_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_return( + self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_return. + + :param body: Required. + :type body: ~specialwords.models.ReturnModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_return. + + :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_return_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: ~specialwords.models.TryModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_try. + + :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.TryModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_try_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_while( + self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_while. + + :param body: Required. + :type body: ~specialwords.models.WhileModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_while. + + :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_while_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_with( + self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_with. + + :param body: Required. + :type body: ~specialwords.models.WithModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_with. + + :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WithModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_with_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def with_yield( + self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_yield. + + :param body: Required. + :type body: ~specialwords.models.YieldModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """with_yield. + + :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_yield_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ModelPropertiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.aio.SpecialWordsClient`'s + :attr:`model_properties` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def same_as_model( + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Required. + :type body: ~specialwords.models.SameAsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + """same_as_model. + + :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_properties_same_as_model_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class Operations: # pylint: disable=too-many-public-methods """ .. warning:: diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py deleted file mode 100644 index 3f2526afc60..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelPropertiesOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelPropertiesOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py deleted file mode 100644 index a4a5b1a4890..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import SpecialWordsClientConfiguration -from ...operations._operations import build_model_properties_same_as_model_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ModelPropertiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.aio.SpecialWordsClient`'s - :attr:`model_properties` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Required. - :type body: ~specialwords.models.SameAsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """same_as_model. - - :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_properties_same_as_model_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py deleted file mode 100644 index 842d670d275..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - SameAsModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "SameAsModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py deleted file mode 100644 index 5a3ac06c36c..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_models.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, overload - -from ... import _model_base -from ..._model_base import rest_field - - -class SameAsModel(_model_base.Model): - """SameAsModel. - - :ivar same_as_model: Required. - :vartype same_as_model: str - """ - - same_as_model: str = rest_field(name="SameAsModel", visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - same_as_model: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py deleted file mode 100644 index 3f2526afc60..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelPropertiesOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelPropertiesOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py deleted file mode 100644 index bc7afa8da2c..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_operations.py +++ /dev/null @@ -1,175 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import SpecialWordsClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_model_properties_same_as_model_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/model-properties/same-as-model" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class ModelPropertiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.SpecialWordsClient`'s - :attr:`model_properties` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Required. - :type body: ~specialwords.models.SameAsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """same_as_model. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def same_as_model( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """same_as_model. - - :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_model_properties_same_as_model_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/modelproperties/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py index d55ccad1f57..c7efcf1f285 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/__init__.py @@ -1 +1,93 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AndModel, + AsModel, + AssertModel, + AsyncModel, + AwaitModel, + BreakModel, + ClassModel, + Constructor, + ContinueModel, + DefModel, + DelModel, + ElifModel, + ElseModel, + ExceptModel, + ExecModel, + FinallyModel, + ForModel, + FromModel, + GlobalModel, + IfModel, + ImportModel, + InModel, + IsModel, + LambdaModel, + NotModel, + OrModel, + PassModel, + RaiseModel, + ReturnModel, + SameAsModel, + TryModel, + WhileModel, + WithModel, + YieldModel, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AndModel", + "AsModel", + "AssertModel", + "AsyncModel", + "AwaitModel", + "BreakModel", + "ClassModel", + "Constructor", + "ContinueModel", + "DefModel", + "DelModel", + "ElifModel", + "ElseModel", + "ExceptModel", + "ExecModel", + "FinallyModel", + "ForModel", + "FromModel", + "GlobalModel", + "IfModel", + "ImportModel", + "InModel", + "IsModel", + "LambdaModel", + "NotModel", + "OrModel", + "PassModel", + "RaiseModel", + "ReturnModel", + "SameAsModel", + "TryModel", + "WhileModel", + "WithModel", + "YieldModel", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py similarity index 96% rename from packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py rename to packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py index 5f9bcdf06ce..57c90b789f4 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_models.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_models.py @@ -9,8 +9,8 @@ from typing import Any, Mapping, overload -from ... import _model_base -from ..._model_base import rest_field +from .. import _model_base +from .._model_base import rest_field class AndModel(_model_base.Model): @@ -825,6 +825,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class SameAsModel(_model_base.Model): + """SameAsModel. + + :ivar same_as_model: Required. + :vartype same_as_model: str + """ + + same_as_model: str = rest_field(name="SameAsModel", visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + same_as_model: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class TryModel(_model_base.Model): """TryModel. diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/encode-duration/encode/duration/header/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/special-words/specialwords/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py deleted file mode 100644 index 5c69707d769..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py deleted file mode 100644 index 64d9253dc91..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_operations.py +++ /dev/null @@ -1,3370 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ...._model_base import SdkJSONEncoder -from ...._serialization import Deserializer, Serializer -from ....aio._configuration import SpecialWordsClientConfiguration -from ...operations._operations import ( - build_models_with_and_request, - build_models_with_as_request, - build_models_with_assert_request, - build_models_with_async_request, - build_models_with_await_request, - build_models_with_break_request, - build_models_with_class_request, - build_models_with_constructor_request, - build_models_with_continue_request, - build_models_with_def_request, - build_models_with_del_request, - build_models_with_elif_request, - build_models_with_else_request, - build_models_with_except_request, - build_models_with_exec_request, - build_models_with_finally_request, - build_models_with_for_request, - build_models_with_from_request, - build_models_with_global_request, - build_models_with_if_request, - build_models_with_import_request, - build_models_with_in_request, - build_models_with_is_request, - build_models_with_lambda_request, - build_models_with_not_request, - build_models_with_or_request, - build_models_with_pass_request, - build_models_with_raise_request, - build_models_with_return_request, - build_models_with_try_request, - build_models_with_while_request, - build_models_with_with_request, - build_models_with_yield_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ModelsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.aio.SpecialWordsClient`'s - :attr:`models` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: ~specialwords.models.AndModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_and. - - :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AndModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_and_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: ~specialwords.models.AsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_as. - - :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_as_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_assert( - self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_assert. - - :param body: Required. - :type body: ~specialwords.models.AssertModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_assert. - - :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_assert_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_async( - self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_async. - - :param body: Required. - :type body: ~specialwords.models.AsyncModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_async. - - :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_async_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_await( - self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_await. - - :param body: Required. - :type body: ~specialwords.models.AwaitModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_await. - - :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_await_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_break( - self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_break. - - :param body: Required. - :type body: ~specialwords.models.BreakModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_break. - - :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_break_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_class( - self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_class. - - :param body: Required. - :type body: ~specialwords.models.ClassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_class. - - :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_class_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Required. - :type body: ~specialwords.models.Constructor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_constructor. - - :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. - :type body: ~specialwords.models.Constructor or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_constructor_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_continue. - - :param body: Required. - :type body: ~specialwords.models.ContinueModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_continue. - - :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_continue_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: ~specialwords.models.DefModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_def. - - :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DefModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_def_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: ~specialwords.models.DelModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_del. - - :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DelModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_del_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_elif( - self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_elif. - - :param body: Required. - :type body: ~specialwords.models.ElifModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_elif. - - :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_elif_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_else( - self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_else. - - :param body: Required. - :type body: ~specialwords.models.ElseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_else. - - :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_else_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_except( - self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_except. - - :param body: Required. - :type body: ~specialwords.models.ExceptModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_except. - - :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_except_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_exec( - self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_exec. - - :param body: Required. - :type body: ~specialwords.models.ExecModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_exec. - - :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_exec_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_finally. - - :param body: Required. - :type body: ~specialwords.models.FinallyModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_finally. - - :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_finally_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: ~specialwords.models.ForModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_for. - - :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ForModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_for_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_from( - self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_from. - - :param body: Required. - :type body: ~specialwords.models.FromModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_from. - - :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FromModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_from_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_global( - self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_global. - - :param body: Required. - :type body: ~specialwords.models.GlobalModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_global. - - :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_global_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: ~specialwords.models.IfModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_if. - - :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IfModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_if_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_import( - self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_import. - - :param body: Required. - :type body: ~specialwords.models.ImportModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_import. - - :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_import_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: ~specialwords.models.InModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_in. - - :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.InModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_in_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: ~specialwords.models.IsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_is. - - :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_is_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_lambda( - self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_lambda. - - :param body: Required. - :type body: ~specialwords.models.LambdaModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_lambda. - - :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_lambda_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: ~specialwords.models.NotModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_not. - - :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.NotModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_not_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: ~specialwords.models.OrModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_or. - - :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.OrModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_or_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_pass( - self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_pass. - - :param body: Required. - :type body: ~specialwords.models.PassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_pass. - - :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.PassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_pass_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_raise( - self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_raise. - - :param body: Required. - :type body: ~specialwords.models.RaiseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_raise. - - :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_raise_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_return( - self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_return. - - :param body: Required. - :type body: ~specialwords.models.ReturnModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_return. - - :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_return_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: ~specialwords.models.TryModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_try. - - :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.TryModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_try_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_while( - self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_while. - - :param body: Required. - :type body: ~specialwords.models.WhileModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_while. - - :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_while_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_with( - self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_with. - - :param body: Required. - :type body: ~specialwords.models.WithModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_with. - - :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WithModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_with_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def with_yield( - self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_yield. - - :param body: Required. - :type body: ~specialwords.models.YieldModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: - """with_yield. - - :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_yield_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py deleted file mode 100644 index 77bc8025644..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/__init__.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - AndModel, - AsModel, - AssertModel, - AsyncModel, - AwaitModel, - BreakModel, - ClassModel, - Constructor, - ContinueModel, - DefModel, - DelModel, - ElifModel, - ElseModel, - ExceptModel, - ExecModel, - FinallyModel, - ForModel, - FromModel, - GlobalModel, - IfModel, - ImportModel, - InModel, - IsModel, - LambdaModel, - NotModel, - OrModel, - PassModel, - RaiseModel, - ReturnModel, - TryModel, - WhileModel, - WithModel, - YieldModel, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AndModel", - "AsModel", - "AssertModel", - "AsyncModel", - "AwaitModel", - "BreakModel", - "ClassModel", - "Constructor", - "ContinueModel", - "DefModel", - "DelModel", - "ElifModel", - "ElseModel", - "ExceptModel", - "ExecModel", - "FinallyModel", - "ForModel", - "FromModel", - "GlobalModel", - "IfModel", - "ImportModel", - "InModel", - "IsModel", - "LambdaModel", - "NotModel", - "OrModel", - "PassModel", - "RaiseModel", - "ReturnModel", - "TryModel", - "WhileModel", - "WithModel", - "YieldModel", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py deleted file mode 100644 index 5c69707d769..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ModelsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ModelsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py deleted file mode 100644 index 6b5a6f25d47..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_operations.py +++ /dev/null @@ -1,3828 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from ..._configuration import SpecialWordsClientConfiguration -from ..._model_base import SdkJSONEncoder -from ..._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_models_with_and_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/and" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_as_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/as" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_assert_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/assert" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_async_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/async" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_await_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/await" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_break_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/break" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_class_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/class" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_constructor_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/constructor" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_continue_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/continue" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_def_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/def" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_del_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/del" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_elif_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/elif" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_else_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/else" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_except_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/except" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_exec_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/exec" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_finally_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/finally" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_for_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/for" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_from_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/from" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_global_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/global" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_if_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/if" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_import_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/import" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_in_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/in" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_is_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/is" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_lambda_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/lambda" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_not_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/not" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_or_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/or" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_pass_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/pass" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_raise_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/raise" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_return_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/return" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_try_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/try" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_while_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/while" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_with_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/with" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_models_with_yield_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = "/special-words/models/yield" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -class ModelsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~specialwords.SpecialWordsClient`'s - :attr:`models` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: ~specialwords.models.AndModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_and. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_and( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_and. - - :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AndModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_and_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: ~specialwords.models.AsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_as. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_as( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_as. - - :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_as_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: ~specialwords.models.AssertModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_assert. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_assert( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_assert. - - :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_assert_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: ~specialwords.models.AsyncModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_async. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_async( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_async. - - :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_async_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: ~specialwords.models.AwaitModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_await. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_await( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_await. - - :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_await_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: ~specialwords.models.BreakModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_break. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_break( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_break. - - :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_break_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: ~specialwords.models.ClassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_class. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_class( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_class. - - :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_class_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Required. - :type body: ~specialwords.models.Constructor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_constructor. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_constructor( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_constructor. - - :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. - :type body: ~specialwords.models.Constructor or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_constructor_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_continue. - - :param body: Required. - :type body: ~specialwords.models.ContinueModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_continue. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_continue( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_continue. - - :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_continue_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: ~specialwords.models.DefModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_def. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_def( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_def. - - :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DefModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_def_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: ~specialwords.models.DelModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_del. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_del( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_del. - - :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.DelModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_del_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: ~specialwords.models.ElifModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_elif. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_elif( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_elif. - - :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_elif_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: ~specialwords.models.ElseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_else. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_else( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_else. - - :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_else_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: ~specialwords.models.ExceptModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_except. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_except( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_except. - - :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_except_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: ~specialwords.models.ExecModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_exec. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_exec( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_exec. - - :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_exec_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """with_finally. - - :param body: Required. - :type body: ~specialwords.models.FinallyModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_finally. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_finally( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_finally. - - :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_finally_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: ~specialwords.models.ForModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_for. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_for( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_for. - - :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ForModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_for_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: ~specialwords.models.FromModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_from. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_from( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_from. - - :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.FromModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_from_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: ~specialwords.models.GlobalModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_global. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_global( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_global. - - :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_global_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: ~specialwords.models.IfModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_if. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_if( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_if. - - :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IfModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_if_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: ~specialwords.models.ImportModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_import. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_import( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_import. - - :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_import_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: ~specialwords.models.InModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_in. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_in( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_in. - - :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.InModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_in_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: ~specialwords.models.IsModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_is. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_is( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_is. - - :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.IsModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_is_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: ~specialwords.models.LambdaModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_lambda. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_lambda( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_lambda. - - :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_lambda_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: ~specialwords.models.NotModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_not. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_not( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_not. - - :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.NotModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_not_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: ~specialwords.models.OrModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_or. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_or( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_or. - - :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.OrModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_or_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: ~specialwords.models.PassModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_pass. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_pass( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_pass. - - :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.PassModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_pass_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: ~specialwords.models.RaiseModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_raise. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_raise( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_raise. - - :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_raise_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: ~specialwords.models.ReturnModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_return. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_return( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_return. - - :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_return_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: ~specialwords.models.TryModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_try. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_try( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_try. - - :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.TryModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_try_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: ~specialwords.models.WhileModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_while. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_while( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_while. - - :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_while_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: ~specialwords.models.WithModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_with. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_with( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_with. - - :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.WithModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_with_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: ~specialwords.models.YieldModel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: - """with_yield. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def with_yield( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """with_yield. - - :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. - :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_models_with_yield_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/models/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py index 05cd579e07d..b4802a9d551 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/__init__.py @@ -12,6 +12,8 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ModelsOperations # type: ignore +from ._operations import ModelPropertiesOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ParametersOperations # type: ignore @@ -20,6 +22,8 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ModelsOperations", + "ModelPropertiesOperations", "Operations", "ParametersOperations", ] diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py index 6749aa3a22c..052a07ae1f7 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py @@ -6,8 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase +import json import sys -from typing import Any, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -23,13 +25,16 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict +from .. import models as _models from .._configuration import SpecialWordsClientConfiguration +from .._model_base import SdkJSONEncoder from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -37,6 +42,482 @@ _SERIALIZER.client_side_validation = False +def build_models_with_and_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/and" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_as_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/as" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_assert_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/assert" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_async_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/async" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_await_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/await" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_break_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/break" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_class_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/class" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_constructor_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/constructor" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_continue_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/continue" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_def_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/def" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_del_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/del" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_elif_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/elif" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_else_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/else" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_except_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/except" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_exec_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/exec" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_finally_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/finally" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_for_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/for" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_from_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/from" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_global_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/global" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_if_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/if" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_import_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/import" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_in_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/in" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_is_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/is" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_lambda_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/lambda" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_not_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/not" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_or_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/or" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_pass_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/pass" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_raise_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/raise" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_return_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/return" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_try_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/try" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_while_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/while" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_with_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/with" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_models_with_yield_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/models/yield" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_model_properties_same_as_model_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/special-words/model-properties/same-as-model" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + def build_operations_and_method_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/special-words/operations/and" @@ -680,6 +1161,3450 @@ def build_parameters_with_cancellation_token_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, **kwargs) +class ModelsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.SpecialWordsClient`'s + :attr:`models` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: ~specialwords.models.AndModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_and(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_and(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_and. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_and( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_and. + + :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AndModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_and_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: ~specialwords.models.AsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_as(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_as(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_as. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_as( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_as. + + :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_as_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: ~specialwords.models.AssertModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_assert(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_assert(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_assert. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_assert( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_assert. + + :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AssertModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_assert_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: ~specialwords.models.AsyncModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_async(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_async(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_async. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_async( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_async. + + :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AsyncModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_async_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: ~specialwords.models.AwaitModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_await(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_await(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_await. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_await( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_await. + + :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.AwaitModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_await_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: ~specialwords.models.BreakModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_break(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_break(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_break. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_break( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_break. + + :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.BreakModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_break_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: ~specialwords.models.ClassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_class(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_class(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_class. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_class( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_class. + + :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ClassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_class_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_constructor( + self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Required. + :type body: ~specialwords.models.Constructor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_constructor(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_constructor(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_constructor. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_constructor( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_constructor. + + :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. + :type body: ~specialwords.models.Constructor or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_constructor_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_continue( + self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_continue. + + :param body: Required. + :type body: ~specialwords.models.ContinueModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_continue(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_continue(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_continue. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_continue( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_continue. + + :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ContinueModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_continue_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: ~specialwords.models.DefModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_def(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_def(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_def. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_def( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_def. + + :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DefModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_def_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: ~specialwords.models.DelModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_del(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_del(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_del. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_del( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_del. + + :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.DelModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_del_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: ~specialwords.models.ElifModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_elif(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_elif. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_elif( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_elif. + + :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElifModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_elif_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: ~specialwords.models.ElseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_else(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_else(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_else. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_else( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_else. + + :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ElseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_else_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: ~specialwords.models.ExceptModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_except(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_except(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_except. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_except( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_except. + + :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExceptModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_except_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: ~specialwords.models.ExecModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_exec(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_exec. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_exec( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_exec. + + :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ExecModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_exec_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_finally( + self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """with_finally. + + :param body: Required. + :type body: ~specialwords.models.FinallyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_finally(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_finally(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_finally. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_finally( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_finally. + + :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FinallyModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_finally_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: ~specialwords.models.ForModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_for(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_for(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_for. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_for( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_for. + + :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ForModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_for_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: ~specialwords.models.FromModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_from(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_from(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_from. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_from( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_from. + + :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.FromModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_from_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: ~specialwords.models.GlobalModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_global(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_global(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_global. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_global( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_global. + + :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.GlobalModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_global_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: ~specialwords.models.IfModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_if(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_if(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_if. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_if( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_if. + + :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IfModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_if_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: ~specialwords.models.ImportModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_import(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_import(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_import. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_import( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_import. + + :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ImportModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_import_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: ~specialwords.models.InModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_in(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_in(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_in. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_in( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_in. + + :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.InModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_in_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: ~specialwords.models.IsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_is(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_is(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_is. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_is( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_is. + + :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.IsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_is_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: ~specialwords.models.LambdaModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_lambda(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_lambda. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_lambda( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_lambda. + + :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.LambdaModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_lambda_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: ~specialwords.models.NotModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_not(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_not(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_not. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_not( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_not. + + :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.NotModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_not_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: ~specialwords.models.OrModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_or(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_or(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_or. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_or( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_or. + + :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.OrModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_or_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: ~specialwords.models.PassModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_pass(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_pass. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_pass( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_pass. + + :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.PassModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_pass_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: ~specialwords.models.RaiseModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_raise(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_raise. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_raise( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_raise. + + :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.RaiseModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_raise_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: ~specialwords.models.ReturnModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_return(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_return(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_return. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_return( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_return. + + :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.ReturnModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_return_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: ~specialwords.models.TryModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_try(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_try(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_try. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_try( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_try. + + :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.TryModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_try_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: ~specialwords.models.WhileModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_while(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_while(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_while. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_while( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_while. + + :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WhileModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_while_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: ~specialwords.models.WithModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_with(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_with(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_with. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_with( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_with. + + :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.WithModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_with_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: ~specialwords.models.YieldModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_yield(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """with_yield. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def with_yield( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """with_yield. + + :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.YieldModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_models_with_yield_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ModelPropertiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specialwords.SpecialWordsClient`'s + :attr:`model_properties` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SpecialWordsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def same_as_model( + self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Required. + :type body: ~specialwords.models.SameAsModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def same_as_model(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def same_as_model(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + """same_as_model. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def same_as_model( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """same_as_model. + + :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. + :type body: ~specialwords.models.SameAsModel or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_properties_same_as_model_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + class Operations: # pylint: disable=too-many-public-methods """ .. warning:: diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py index bb6f807e44c..df4e1f6246e 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py @@ -18,6 +18,7 @@ async def client(credential, authentication_policy): SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy, + polling_interval=0, ) as client: yield client diff --git a/packages/typespec-python/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py b/packages/typespec-python/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py index 4a2ca1309b5..d0e73ad772a 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py +++ b/packages/typespec-python/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py @@ -18,6 +18,7 @@ def client(credential, authentication_policy): SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy, + polling_interval=0, ) as client: yield client diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py index 3a9a0c801b5..02415c9d3c2 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import BytesClientConfiguration @@ -64,8 +64,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: _models3.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -81,7 +81,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -97,7 +97,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models3.DefaultBytesProperty: """default. :param body: Required. @@ -111,8 +111,8 @@ async def default( """ async def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: Union[_models3.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -133,7 +133,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -170,7 +170,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models3.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -179,8 +179,8 @@ async def default( @overload async def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: _models3.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -196,7 +196,7 @@ async def base64( @overload async def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -212,7 +212,7 @@ async def base64( @overload async def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models3.Base64BytesProperty: """base64. :param body: Required. @@ -226,8 +226,8 @@ async def base64( """ async def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: Union[_models3.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -248,7 +248,7 @@ async def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -285,7 +285,7 @@ async def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -294,8 +294,8 @@ async def base64( @overload async def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: _models3.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -311,7 +311,7 @@ async def base64_url( @overload async def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -327,7 +327,7 @@ async def base64_url( @overload async def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -341,8 +341,8 @@ async def base64_url( """ async def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: Union[_models3.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -363,7 +363,7 @@ async def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -400,7 +400,7 @@ async def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -409,8 +409,8 @@ async def base64_url( @overload async def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: _models3.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -427,7 +427,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -444,7 +444,7 @@ async def base64_url_array( @overload async def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -459,8 +459,8 @@ async def base64_url_array( """ async def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: Union[_models3.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -483,7 +483,7 @@ async def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -520,7 +520,7 @@ async def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models3.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py index d66408f7201..eb4982e1f8f 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import BytesClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -129,8 +129,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: _models2.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -146,7 +146,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -162,7 +162,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: + ) -> _models2.DefaultBytesProperty: """default. :param body: Required. @@ -176,8 +176,8 @@ def default( """ def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: + self, body: Union[_models2.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.DefaultBytesProperty: """default. :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. @@ -198,7 +198,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.DefaultBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -235,7 +235,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) + deserialized = _deserialize(_models2.DefaultBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -244,8 +244,8 @@ def default( @overload def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: _models2.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -261,7 +261,7 @@ def base64( @overload def base64( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -277,7 +277,7 @@ def base64( @overload def base64( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: + ) -> _models2.Base64BytesProperty: """base64. :param body: Required. @@ -291,8 +291,8 @@ def base64( """ def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: + self, body: Union[_models2.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64BytesProperty: """base64. :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. @@ -313,7 +313,7 @@ def base64( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64BytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -350,7 +350,7 @@ def base64( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64BytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -359,8 +359,8 @@ def base64( @overload def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: _models2.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -376,7 +376,7 @@ def base64_url( @overload def base64_url( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -392,7 +392,7 @@ def base64_url( @overload def base64_url( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Required. @@ -406,8 +406,8 @@ def base64_url( """ def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: + self, body: Union[_models2.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64urlBytesProperty: """base64_url. :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. @@ -428,7 +428,7 @@ def base64_url( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64urlBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -465,7 +465,7 @@ def base64_url( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64urlBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -474,8 +474,8 @@ def base64_url( @overload def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: _models2.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -492,7 +492,7 @@ def base64_url_array( @overload def base64_url_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -509,7 +509,7 @@ def base64_url_array( @overload def base64_url_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Required. @@ -524,8 +524,8 @@ def base64_url_array( """ def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: + self, body: Union[_models2.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Base64urlArrayBytesProperty: """base64_url_array. :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] @@ -548,7 +548,7 @@ def base64_url_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -585,7 +585,7 @@ def base64_url_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) + deserialized = _deserialize(_models2.Base64urlArrayBytesProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py index 225e1a14bf4..5cb74599ca8 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import DatetimeClientConfiguration @@ -65,8 +65,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: _models3.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -82,7 +82,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -98,7 +98,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Required. @@ -112,8 +112,8 @@ async def default( """ async def default( - self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: Union[_models3.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -134,7 +134,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -171,7 +171,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -180,8 +180,8 @@ async def default( @overload async def rfc3339( - self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: _models3.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -197,7 +197,7 @@ async def rfc3339( @overload async def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -213,7 +213,7 @@ async def rfc3339( @overload async def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -227,8 +227,8 @@ async def rfc3339( """ async def rfc3339( - self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: Union[_models3.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -249,7 +249,7 @@ async def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -286,7 +286,7 @@ async def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models3.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -295,8 +295,8 @@ async def rfc3339( @overload async def rfc7231( - self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: _models3.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -312,7 +312,7 @@ async def rfc7231( @overload async def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -328,7 +328,7 @@ async def rfc7231( @overload async def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -342,8 +342,8 @@ async def rfc7231( """ async def rfc7231( - self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: Union[_models3.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -364,7 +364,7 @@ async def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -401,7 +401,7 @@ async def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models3.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -410,8 +410,8 @@ async def rfc7231( @overload async def unix_timestamp( - self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: _models3.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -428,7 +428,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -445,7 +445,7 @@ async def unix_timestamp( @overload async def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -460,8 +460,8 @@ async def unix_timestamp( """ async def unix_timestamp( - self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: Union[_models3.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -484,7 +484,7 @@ async def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -521,7 +521,7 @@ async def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -530,8 +530,12 @@ async def unix_timestamp( @overload async def unix_timestamp_array( - self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, + body: _models3.UnixTimestampArrayDatetimeProperty, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -548,7 +552,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -565,7 +569,7 @@ async def unix_timestamp_array( @overload async def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -580,8 +584,8 @@ async def unix_timestamp_array( """ async def unix_timestamp_array( - self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models3.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models3.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -604,7 +608,7 @@ async def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models3.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -641,7 +645,7 @@ async def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models3.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py index 631626311cd..2c4f2b09a24 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import DatetimeClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -146,8 +146,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: _models2.DefaultDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -163,7 +163,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -179,7 +179,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Required. @@ -193,8 +193,8 @@ def default( """ def default( - self, body: Union[_models.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDatetimeProperty: + self, body: Union[_models2.DefaultDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.DefaultDatetimeProperty: """default. :param body: Is one of the following types: DefaultDatetimeProperty, JSON, IO[bytes] Required. @@ -215,7 +215,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.DefaultDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -252,7 +252,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.DefaultDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -261,8 +261,8 @@ def default( @overload def rfc3339( - self, body: _models.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: _models2.Rfc3339DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -278,7 +278,7 @@ def rfc3339( @overload def rfc3339( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -294,7 +294,7 @@ def rfc3339( @overload def rfc3339( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Required. @@ -308,8 +308,8 @@ def rfc3339( """ def rfc3339( - self, body: Union[_models.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc3339DatetimeProperty: + self, body: Union[_models2.Rfc3339DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Rfc3339DatetimeProperty: """rfc3339. :param body: Is one of the following types: Rfc3339DatetimeProperty, JSON, IO[bytes] Required. @@ -330,7 +330,7 @@ def rfc3339( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Rfc3339DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -367,7 +367,7 @@ def rfc3339( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc3339DatetimeProperty, response.json()) + deserialized = _deserialize(_models2.Rfc3339DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -376,8 +376,8 @@ def rfc3339( @overload def rfc7231( - self, body: _models.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: _models2.Rfc7231DatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -393,7 +393,7 @@ def rfc7231( @overload def rfc7231( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -409,7 +409,7 @@ def rfc7231( @overload def rfc7231( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Required. @@ -423,8 +423,8 @@ def rfc7231( """ def rfc7231( - self, body: Union[_models.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Rfc7231DatetimeProperty: + self, body: Union[_models2.Rfc7231DatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Rfc7231DatetimeProperty: """rfc7231. :param body: Is one of the following types: Rfc7231DatetimeProperty, JSON, IO[bytes] Required. @@ -445,7 +445,7 @@ def rfc7231( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Rfc7231DatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -482,7 +482,7 @@ def rfc7231( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Rfc7231DatetimeProperty, response.json()) + deserialized = _deserialize(_models2.Rfc7231DatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -491,8 +491,8 @@ def rfc7231( @overload def unix_timestamp( - self, body: _models.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: _models2.UnixTimestampDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -509,7 +509,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -526,7 +526,7 @@ def unix_timestamp( @overload def unix_timestamp( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Required. @@ -541,8 +541,8 @@ def unix_timestamp( """ def unix_timestamp( - self, body: Union[_models.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampDatetimeProperty: + self, body: Union[_models2.UnixTimestampDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.UnixTimestampDatetimeProperty: """unix_timestamp. :param body: Is one of the following types: UnixTimestampDatetimeProperty, JSON, IO[bytes] @@ -565,7 +565,7 @@ def unix_timestamp( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.UnixTimestampDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -602,7 +602,7 @@ def unix_timestamp( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.UnixTimestampDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -611,8 +611,12 @@ def unix_timestamp( @overload def unix_timestamp_array( - self, body: _models.UnixTimestampArrayDatetimeProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, + body: _models2.UnixTimestampArrayDatetimeProperty, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -629,7 +633,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -646,7 +650,7 @@ def unix_timestamp_array( @overload def unix_timestamp_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Required. @@ -661,8 +665,8 @@ def unix_timestamp_array( """ def unix_timestamp_array( - self, body: Union[_models.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.UnixTimestampArrayDatetimeProperty: + self, body: Union[_models2.UnixTimestampArrayDatetimeProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.UnixTimestampArrayDatetimeProperty: """unix_timestamp_array. :param body: Is one of the following types: UnixTimestampArrayDatetimeProperty, JSON, IO[bytes] @@ -685,7 +689,7 @@ def unix_timestamp_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.UnixTimestampArrayDatetimeProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -722,7 +726,7 @@ def unix_timestamp_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.UnixTimestampArrayDatetimeProperty, response.json()) + deserialized = _deserialize(_models2.UnixTimestampArrayDatetimeProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py index 81d70db8b17..7aad977e72f 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import DurationClientConfiguration @@ -66,8 +66,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def default( - self, body: _models.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + self, body: _models2.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.DefaultDurationProperty: """default. :param body: Required. @@ -83,7 +83,7 @@ async def default( @overload async def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + ) -> _models2.DefaultDurationProperty: """default. :param body: Required. @@ -99,7 +99,7 @@ async def default( @overload async def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + ) -> _models2.DefaultDurationProperty: """default. :param body: Required. @@ -113,8 +113,8 @@ async def default( """ async def default( - self, body: Union[_models.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDurationProperty: + self, body: Union[_models2.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.DefaultDurationProperty: """default. :param body: Is one of the following types: DefaultDurationProperty, JSON, IO[bytes] Required. @@ -135,7 +135,7 @@ async def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.DefaultDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -172,7 +172,7 @@ async def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDurationProperty, response.json()) + deserialized = _deserialize(_models2.DefaultDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -181,8 +181,8 @@ async def default( @overload async def iso8601( - self, body: _models.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + self, body: _models2.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -198,7 +198,7 @@ async def iso8601( @overload async def iso8601( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + ) -> _models2.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -214,7 +214,7 @@ async def iso8601( @overload async def iso8601( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + ) -> _models2.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -228,8 +228,8 @@ async def iso8601( """ async def iso8601( - self, body: Union[_models.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.ISO8601DurationProperty: + self, body: Union[_models2.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.ISO8601DurationProperty: """iso8601. :param body: Is one of the following types: ISO8601DurationProperty, JSON, IO[bytes] Required. @@ -250,7 +250,7 @@ async def iso8601( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ISO8601DurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.ISO8601DurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -287,7 +287,7 @@ async def iso8601( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ISO8601DurationProperty, response.json()) + deserialized = _deserialize(_models2.ISO8601DurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -296,8 +296,8 @@ async def iso8601( @overload async def int32_seconds( - self, body: _models.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + self, body: _models2.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -314,7 +314,7 @@ async def int32_seconds( @overload async def int32_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + ) -> _models2.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -331,7 +331,7 @@ async def int32_seconds( @overload async def int32_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + ) -> _models2.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -346,8 +346,8 @@ async def int32_seconds( """ async def int32_seconds( - self, body: Union[_models.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + self, body: Union[_models2.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Int32SecondsDurationProperty: """int32_seconds. :param body: Is one of the following types: Int32SecondsDurationProperty, JSON, IO[bytes] @@ -370,7 +370,7 @@ async def int32_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Int32SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Int32SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -407,7 +407,7 @@ async def int32_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Int32SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models2.Int32SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -416,8 +416,8 @@ async def int32_seconds( @overload async def float_seconds( - self, body: _models.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + self, body: _models2.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -434,7 +434,7 @@ async def float_seconds( @overload async def float_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + ) -> _models2.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -451,7 +451,7 @@ async def float_seconds( @overload async def float_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + ) -> _models2.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -466,8 +466,8 @@ async def float_seconds( """ async def float_seconds( - self, body: Union[_models.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + self, body: Union[_models2.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.FloatSecondsDurationProperty: """float_seconds. :param body: Is one of the following types: FloatSecondsDurationProperty, JSON, IO[bytes] @@ -490,7 +490,7 @@ async def float_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FloatSecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.FloatSecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -527,7 +527,7 @@ async def float_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FloatSecondsDurationProperty, response.json()) + deserialized = _deserialize(_models2.FloatSecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -536,8 +536,8 @@ async def float_seconds( @overload async def float64_seconds( - self, body: _models.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + self, body: _models2.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -554,7 +554,7 @@ async def float64_seconds( @overload async def float64_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + ) -> _models2.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -571,7 +571,7 @@ async def float64_seconds( @overload async def float64_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + ) -> _models2.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -586,8 +586,8 @@ async def float64_seconds( """ async def float64_seconds( - self, body: Union[_models.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + self, body: Union[_models2.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Float64SecondsDurationProperty: """float64_seconds. :param body: Is one of the following types: Float64SecondsDurationProperty, JSON, IO[bytes] @@ -610,7 +610,7 @@ async def float64_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Float64SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Float64SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -647,7 +647,7 @@ async def float64_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Float64SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models2.Float64SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -656,8 +656,8 @@ async def float64_seconds( @overload async def float_seconds_array( - self, body: _models.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + self, body: _models2.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -674,7 +674,7 @@ async def float_seconds_array( @overload async def float_seconds_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + ) -> _models2.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -691,7 +691,7 @@ async def float_seconds_array( @overload async def float_seconds_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + ) -> _models2.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -706,8 +706,8 @@ async def float_seconds_array( """ async def float_seconds_array( - self, body: Union[_models.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + self, body: Union[_models2.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Is one of the following types: FloatSecondsDurationArrayProperty, JSON, IO[bytes] @@ -730,7 +730,7 @@ async def float_seconds_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -767,7 +767,7 @@ async def float_seconds_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FloatSecondsDurationArrayProperty, response.json()) + deserialized = _deserialize(_models2.FloatSecondsDurationArrayProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py index 4f00044c61b..34a3aec9b4c 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import DurationClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -163,8 +163,8 @@ def __init__(self, *args, **kwargs): @overload def default( - self, body: _models.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + self, body: _models1.DefaultDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.DefaultDurationProperty: """default. :param body: Required. @@ -180,7 +180,7 @@ def default( @overload def default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + ) -> _models1.DefaultDurationProperty: """default. :param body: Required. @@ -196,7 +196,7 @@ def default( @overload def default( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultDurationProperty: + ) -> _models1.DefaultDurationProperty: """default. :param body: Required. @@ -210,8 +210,8 @@ def default( """ def default( - self, body: Union[_models.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultDurationProperty: + self, body: Union[_models1.DefaultDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.DefaultDurationProperty: """default. :param body: Is one of the following types: DefaultDurationProperty, JSON, IO[bytes] Required. @@ -232,7 +232,7 @@ def default( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.DefaultDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -269,7 +269,7 @@ def default( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DefaultDurationProperty, response.json()) + deserialized = _deserialize(_models1.DefaultDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -278,8 +278,8 @@ def default( @overload def iso8601( - self, body: _models.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + self, body: _models1.ISO8601DurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -295,7 +295,7 @@ def iso8601( @overload def iso8601( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + ) -> _models1.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -311,7 +311,7 @@ def iso8601( @overload def iso8601( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ISO8601DurationProperty: + ) -> _models1.ISO8601DurationProperty: """iso8601. :param body: Required. @@ -325,8 +325,8 @@ def iso8601( """ def iso8601( - self, body: Union[_models.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.ISO8601DurationProperty: + self, body: Union[_models1.ISO8601DurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.ISO8601DurationProperty: """iso8601. :param body: Is one of the following types: ISO8601DurationProperty, JSON, IO[bytes] Required. @@ -347,7 +347,7 @@ def iso8601( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ISO8601DurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.ISO8601DurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -384,7 +384,7 @@ def iso8601( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ISO8601DurationProperty, response.json()) + deserialized = _deserialize(_models1.ISO8601DurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -393,8 +393,8 @@ def iso8601( @overload def int32_seconds( - self, body: _models.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + self, body: _models1.Int32SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -411,7 +411,7 @@ def int32_seconds( @overload def int32_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + ) -> _models1.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -428,7 +428,7 @@ def int32_seconds( @overload def int32_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + ) -> _models1.Int32SecondsDurationProperty: """int32_seconds. :param body: Required. @@ -443,8 +443,8 @@ def int32_seconds( """ def int32_seconds( - self, body: Union[_models.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Int32SecondsDurationProperty: + self, body: Union[_models1.Int32SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.Int32SecondsDurationProperty: """int32_seconds. :param body: Is one of the following types: Int32SecondsDurationProperty, JSON, IO[bytes] @@ -467,7 +467,7 @@ def int32_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Int32SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.Int32SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -504,7 +504,7 @@ def int32_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Int32SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models1.Int32SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -513,8 +513,8 @@ def int32_seconds( @overload def float_seconds( - self, body: _models.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + self, body: _models1.FloatSecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -531,7 +531,7 @@ def float_seconds( @overload def float_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + ) -> _models1.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -548,7 +548,7 @@ def float_seconds( @overload def float_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + ) -> _models1.FloatSecondsDurationProperty: """float_seconds. :param body: Required. @@ -563,8 +563,8 @@ def float_seconds( """ def float_seconds( - self, body: Union[_models.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.FloatSecondsDurationProperty: + self, body: Union[_models1.FloatSecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.FloatSecondsDurationProperty: """float_seconds. :param body: Is one of the following types: FloatSecondsDurationProperty, JSON, IO[bytes] @@ -587,7 +587,7 @@ def float_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FloatSecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.FloatSecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -624,7 +624,7 @@ def float_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FloatSecondsDurationProperty, response.json()) + deserialized = _deserialize(_models1.FloatSecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -633,8 +633,8 @@ def float_seconds( @overload def float64_seconds( - self, body: _models.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + self, body: _models1.Float64SecondsDurationProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -651,7 +651,7 @@ def float64_seconds( @overload def float64_seconds( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + ) -> _models1.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -668,7 +668,7 @@ def float64_seconds( @overload def float64_seconds( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + ) -> _models1.Float64SecondsDurationProperty: """float64_seconds. :param body: Required. @@ -683,8 +683,8 @@ def float64_seconds( """ def float64_seconds( - self, body: Union[_models.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Float64SecondsDurationProperty: + self, body: Union[_models1.Float64SecondsDurationProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.Float64SecondsDurationProperty: """float64_seconds. :param body: Is one of the following types: Float64SecondsDurationProperty, JSON, IO[bytes] @@ -707,7 +707,7 @@ def float64_seconds( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Float64SecondsDurationProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.Float64SecondsDurationProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -744,7 +744,7 @@ def float64_seconds( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Float64SecondsDurationProperty, response.json()) + deserialized = _deserialize(_models1.Float64SecondsDurationProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -753,8 +753,8 @@ def float64_seconds( @overload def float_seconds_array( - self, body: _models.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + self, body: _models1.FloatSecondsDurationArrayProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -771,7 +771,7 @@ def float_seconds_array( @overload def float_seconds_array( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + ) -> _models1.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -788,7 +788,7 @@ def float_seconds_array( @overload def float_seconds_array( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + ) -> _models1.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Required. @@ -803,8 +803,8 @@ def float_seconds_array( """ def float_seconds_array( - self, body: Union[_models.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.FloatSecondsDurationArrayProperty: + self, body: Union[_models1.FloatSecondsDurationArrayProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.FloatSecondsDurationArrayProperty: """float_seconds_array. :param body: Is one of the following types: FloatSecondsDurationArrayProperty, JSON, IO[bytes] @@ -827,7 +827,7 @@ def float_seconds_array( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.FloatSecondsDurationArrayProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -864,7 +864,7 @@ def float_seconds_array( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.FloatSecondsDurationArrayProperty, response.json()) + deserialized = _deserialize(_models1.FloatSecondsDurationArrayProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py index 1a4f1d944ec..3b4cc092892 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import NumericClientConfiguration @@ -63,8 +63,8 @@ def __init__(self, *args, **kwargs) -> None: @overload async def safeint_as_string( - self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + self, value: _models2.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -80,7 +80,7 @@ async def safeint_as_string( @overload async def safeint_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + ) -> _models2.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -96,7 +96,7 @@ async def safeint_as_string( @overload async def safeint_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + ) -> _models2.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -110,8 +110,8 @@ async def safeint_as_string( """ async def safeint_as_string( - self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.SafeintAsStringProperty: + self, value: Union[_models2.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.SafeintAsStringProperty: """safeint_as_string. :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. @@ -132,7 +132,7 @@ async def safeint_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SafeintAsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.SafeintAsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -169,7 +169,7 @@ async def safeint_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SafeintAsStringProperty, response.json()) + deserialized = _deserialize(_models2.SafeintAsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -178,8 +178,8 @@ async def safeint_as_string( @overload async def uint32_as_string_optional( - self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + self, value: _models2.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -195,7 +195,7 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + ) -> _models2.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -211,7 +211,7 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + ) -> _models2.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -225,8 +225,8 @@ async def uint32_as_string_optional( """ async def uint32_as_string_optional( - self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Uint32AsStringProperty: + self, value: Union[_models2.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. @@ -247,7 +247,7 @@ async def uint32_as_string_optional( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Uint32AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Uint32AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -284,7 +284,7 @@ async def uint32_as_string_optional( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Uint32AsStringProperty, response.json()) + deserialized = _deserialize(_models2.Uint32AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -293,8 +293,8 @@ async def uint32_as_string_optional( @overload async def uint8_as_string( - self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + self, value: _models2.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models2.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -310,7 +310,7 @@ async def uint8_as_string( @overload async def uint8_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + ) -> _models2.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -326,7 +326,7 @@ async def uint8_as_string( @overload async def uint8_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + ) -> _models2.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -340,8 +340,8 @@ async def uint8_as_string( """ async def uint8_as_string( - self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Uint8AsStringProperty: + self, value: Union[_models2.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models2.Uint8AsStringProperty: """uint8_as_string. :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. @@ -362,7 +362,7 @@ async def uint8_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models2.Uint8AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -399,7 +399,7 @@ async def uint8_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Uint8AsStringProperty, response.json()) + deserialized = _deserialize(_models2.Uint8AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py index ddd38bc07c9..41da6fc1959 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import NumericClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -112,8 +112,8 @@ def __init__(self, *args, **kwargs): @overload def safeint_as_string( - self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + self, value: _models1.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -129,7 +129,7 @@ def safeint_as_string( @overload def safeint_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + ) -> _models1.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -145,7 +145,7 @@ def safeint_as_string( @overload def safeint_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SafeintAsStringProperty: + ) -> _models1.SafeintAsStringProperty: """safeint_as_string. :param value: Required. @@ -159,8 +159,8 @@ def safeint_as_string( """ def safeint_as_string( - self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.SafeintAsStringProperty: + self, value: Union[_models1.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.SafeintAsStringProperty: """safeint_as_string. :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. @@ -181,7 +181,7 @@ def safeint_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SafeintAsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.SafeintAsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -218,7 +218,7 @@ def safeint_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SafeintAsStringProperty, response.json()) + deserialized = _deserialize(_models1.SafeintAsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -227,8 +227,8 @@ def safeint_as_string( @overload def uint32_as_string_optional( - self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + self, value: _models1.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -244,7 +244,7 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + ) -> _models1.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -260,7 +260,7 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint32AsStringProperty: + ) -> _models1.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Required. @@ -274,8 +274,8 @@ def uint32_as_string_optional( """ def uint32_as_string_optional( - self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Uint32AsStringProperty: + self, value: Union[_models1.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.Uint32AsStringProperty: """uint32_as_string_optional. :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. @@ -296,7 +296,7 @@ def uint32_as_string_optional( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Uint32AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.Uint32AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -333,7 +333,7 @@ def uint32_as_string_optional( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Uint32AsStringProperty, response.json()) + deserialized = _deserialize(_models1.Uint32AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -342,8 +342,8 @@ def uint32_as_string_optional( @overload def uint8_as_string( - self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + self, value: _models1.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models1.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -359,7 +359,7 @@ def uint8_as_string( @overload def uint8_as_string( self, value: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + ) -> _models1.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -375,7 +375,7 @@ def uint8_as_string( @overload def uint8_as_string( self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Uint8AsStringProperty: + ) -> _models1.Uint8AsStringProperty: """uint8_as_string. :param value: Required. @@ -389,8 +389,8 @@ def uint8_as_string( """ def uint8_as_string( - self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Uint8AsStringProperty: + self, value: Union[_models1.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models1.Uint8AsStringProperty: """uint8_as_string. :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. @@ -411,7 +411,7 @@ def uint8_as_string( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + cls: ClsType[_models1.Uint8AsStringProperty] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -448,7 +448,7 @@ def uint8_as_string( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Uint8AsStringProperty, response.json()) + deserialized = _deserialize(_models1.Uint8AsStringProperty, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py index 5a458654a48..b3152f25c50 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import BasicClientConfiguration @@ -56,7 +56,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def simple(self, body: _models2.User, *, content_type: str = "application/json", **kwargs: Any) -> None: """simple. :param body: Required. @@ -97,7 +97,7 @@ async def simple(self, body: IO[bytes], *, content_type: str = "application/json :raises ~corehttp.exceptions.HttpResponseError: """ - async def simple(self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any) -> None: + async def simple(self, body: Union[_models2.User, JSON, IO[bytes]], **kwargs: Any) -> None: """simple. :param body: Is one of the following types: User, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py index e618712b5ed..88c50808e89 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/parameters/basic/explicitbody/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import BasicClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def simple(self, body: _models.User, *, content_type: str = "application/json", **kwargs: Any) -> None: + def simple(self, body: _models1.User, *, content_type: str = "application/json", **kwargs: Any) -> None: """simple. :param body: Required. @@ -114,7 +114,7 @@ def simple(self, body: IO[bytes], *, content_type: str = "application/json", **k """ def simple( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.User, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.User, JSON, IO[bytes]], **kwargs: Any ) -> None: """simple. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py index ec22581ae63..f70f6f14c8d 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/_operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from .._model_base import SdkJSONEncoder from .._serialization import Serializer from .._vendor import BodyOptionalityClientMixinABC @@ -72,7 +72,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -115,7 +115,7 @@ def required_explicit(self, body: IO[bytes], *, content_type: str = "application """ def required_explicit( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.BodyModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """required_explicit. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py index 7dffa9c6de0..3596af95acb 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/_operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._model_base import SdkJSONEncoder from ..._operations._operations import ( build_body_optionality_required_explicit_request, @@ -44,7 +44,7 @@ class BodyOptionalityClientOperationsMixin(BodyOptionalityClientMixinABC): @overload async def required_explicit( - self, body: _models.BodyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.BodyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """required_explicit. @@ -88,7 +88,7 @@ async def required_explicit( :raises ~corehttp.exceptions.HttpResponseError: """ - async def required_explicit(self, body: Union[_models.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def required_explicit(self, body: Union[_models2.BodyModel, JSON, IO[bytes]], **kwargs: Any) -> None: """required_explicit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py index 9de2980870a..b967dd3daf3 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import BodyOptionalityClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -101,7 +101,7 @@ async def set( :raises ~corehttp.exceptions.HttpResponseError: """ - async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def set(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """set. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. @@ -159,7 +159,7 @@ async def set(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = @overload async def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models3.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -203,7 +203,7 @@ async def omit( :raises ~corehttp.exceptions.HttpResponseError: """ - async def omit(self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: + async def omit(self, body: Optional[Union[_models3.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any) -> None: """omit. :param body: Is one of the following types: BodyModel, JSON, IO[bytes] Default value is None. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py index 7d99ca79c8e..359aad662de 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/optionalexplicit/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import BodyOptionalityClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -87,7 +87,7 @@ def __init__(self, *args, **kwargs): @overload def set( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """set. @@ -130,7 +130,7 @@ def set(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applicat """ def set( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """set. @@ -189,7 +189,7 @@ def set( # pylint: disable=inconsistent-return-statements @overload def omit( - self, body: Optional[_models.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any + self, body: Optional[_models2.BodyModel] = None, *, content_type: str = "application/json", **kwargs: Any ) -> None: """omit. @@ -232,7 +232,7 @@ def omit(self, body: Optional[IO[bytes]] = None, *, content_type: str = "applica """ def omit( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[_models.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any + self, body: Optional[Union[_models2.BodyModel, JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """omit. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py index a1c6e8aa48f..02f72182c7d 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpreadClientConfiguration @@ -172,7 +172,7 @@ async def spread_as_request_body( @overload async def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -219,7 +219,7 @@ async def spread_composite_request_only_with_body( """ async def spread_composite_request_only_with_body( - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models2.BodyParameter, JSON, IO[bytes]], **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -324,7 +324,7 @@ async def spread_composite_request_without_body(self, name: str, *, test_header: async def spread_composite_request( self, name: str, - body: _models.BodyParameter, + body: _models2.BodyParameter, *, test_header: str, content_type: str = "application/json", @@ -387,7 +387,7 @@ async def spread_composite_request( """ async def spread_composite_request( - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + self, name: str, body: Union[_models2.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any ) -> None: """spread_composite_request. diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py index 4fdbaf9b805..6d1daa2f100 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/model/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import SpreadClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -257,7 +257,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements @overload def spread_composite_request_only_with_body( - self, body: _models.BodyParameter, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.BodyParameter, *, content_type: str = "application/json", **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -304,7 +304,7 @@ def spread_composite_request_only_with_body( """ def spread_composite_request_only_with_body( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BodyParameter, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.BodyParameter, JSON, IO[bytes]], **kwargs: Any ) -> None: """spread_composite_request_only_with_body. @@ -411,7 +411,7 @@ def spread_composite_request_without_body( # pylint: disable=inconsistent-retur def spread_composite_request( self, name: str, - body: _models.BodyParameter, + body: _models1.BodyParameter, *, test_header: str, content_type: str = "application/json", @@ -474,7 +474,7 @@ def spread_composite_request( """ def spread_composite_request( # pylint: disable=inconsistent-return-statements - self, name: str, body: Union[_models.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any + self, name: str, body: Union[_models1.BodyParameter, JSON, IO[bytes]], *, test_header: str, **kwargs: Any ) -> None: """spread_composite_request. diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py index 99074e69ebc..2914d209c43 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import ContentNegotiationClientConfiguration @@ -112,7 +112,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: return deserialized # type: ignore - async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: + async def get_avatar_as_json(self, **kwargs: Any) -> _models2.PngImageAsJson: """get_avatar_as_json. :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping @@ -131,7 +131,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: _params = kwargs.pop("params", {}) or {} accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[_models2.PngImageAsJson] = kwargs.pop("cls", None) _request = build_different_body_get_avatar_as_json_request( accept=accept, @@ -163,7 +163,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PngImageAsJson, response.json()) + deserialized = _deserialize(_models2.PngImageAsJson, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py index eac88145e4c..2612d220b63 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/differentbody/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import ContentNegotiationClientConfiguration from ..._model_base import _deserialize from ..._serialization import Deserializer, Serializer @@ -137,7 +137,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: return deserialized # type: ignore - def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: + def get_avatar_as_json(self, **kwargs: Any) -> _models1.PngImageAsJson: """get_avatar_as_json. :return: PngImageAsJson. The PngImageAsJson is compatible with MutableMapping @@ -156,7 +156,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: _params = kwargs.pop("params", {}) or {} accept: Literal["application/json"] = kwargs.pop("accept", _headers.pop("accept", "application/json")) - cls: ClsType[_models.PngImageAsJson] = kwargs.pop("cls", None) + cls: ClsType[_models1.PngImageAsJson] = kwargs.pop("cls", None) _request = build_different_body_get_avatar_as_json_request( accept=accept, @@ -188,7 +188,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PngImageAsJson, response.json()) + deserialized = _deserialize(_models1.PngImageAsJson, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py index aaec50800bd..77faf19d2fc 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from .... import _model_base, models as _models +from .... import _model_base, models as _models3 from ...._serialization import Deserializer, Serializer from ...._vendor import FileType, prepare_multipart_form_data from ....aio._configuration import MultiPartClientConfiguration @@ -65,7 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) @overload - async def basic(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: + async def basic(self, body: _models3.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -86,7 +86,7 @@ async def basic(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def basic(self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any) -> None: + async def basic(self, body: Union[_models3.MultiPartRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Is either a MultiPartRequest type or a JSON type. Required. @@ -137,7 +137,7 @@ async def basic(self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_array_and_basic(self, body: _models.ComplexPartsRequest, **kwargs: Any) -> None: + async def file_array_and_basic(self, body: _models3.ComplexPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -158,7 +158,7 @@ async def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def file_array_and_basic(self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any) -> None: + async def file_array_and_basic(self, body: Union[_models3.ComplexPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Is either a ComplexPartsRequest type or a JSON type. Required. @@ -209,7 +209,7 @@ async def file_array_and_basic(self, body: Union[_models.ComplexPartsRequest, JS return cls(pipeline_response, None, {}) # type: ignore @overload - async def json_part(self, body: _models.JsonPartRequest, **kwargs: Any) -> None: + async def json_part(self, body: _models3.JsonPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Required. @@ -230,7 +230,7 @@ async def json_part(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def json_part(self, body: Union[_models.JsonPartRequest, JSON], **kwargs: Any) -> None: + async def json_part(self, body: Union[_models3.JsonPartRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Is either a JsonPartRequest type or a JSON type. Required. @@ -281,7 +281,7 @@ async def json_part(self, body: Union[_models.JsonPartRequest, JSON], **kwargs: return cls(pipeline_response, None, {}) # type: ignore @overload - async def binary_array_parts(self, body: _models.BinaryArrayPartsRequest, **kwargs: Any) -> None: + async def binary_array_parts(self, body: _models3.BinaryArrayPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -302,7 +302,7 @@ async def binary_array_parts(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def binary_array_parts(self, body: Union[_models.BinaryArrayPartsRequest, JSON], **kwargs: Any) -> None: + async def binary_array_parts(self, body: Union[_models3.BinaryArrayPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Is either a BinaryArrayPartsRequest type or a JSON type. Required. @@ -353,7 +353,7 @@ async def binary_array_parts(self, body: Union[_models.BinaryArrayPartsRequest, return cls(pipeline_response, None, {}) # type: ignore @overload - async def multi_binary_parts(self, body: _models.MultiBinaryPartsRequest, **kwargs: Any) -> None: + async def multi_binary_parts(self, body: _models3.MultiBinaryPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -374,7 +374,7 @@ async def multi_binary_parts(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def multi_binary_parts(self, body: Union[_models.MultiBinaryPartsRequest, JSON], **kwargs: Any) -> None: + async def multi_binary_parts(self, body: Union[_models3.MultiBinaryPartsRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Is either a MultiBinaryPartsRequest type or a JSON type. Required. @@ -425,7 +425,7 @@ async def multi_binary_parts(self, body: Union[_models.MultiBinaryPartsRequest, return cls(pipeline_response, None, {}) # type: ignore @overload - async def check_file_name_and_content_type(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: + async def check_file_name_and_content_type(self, body: _models3.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -447,7 +447,7 @@ async def check_file_name_and_content_type(self, body: JSON, **kwargs: Any) -> N """ async def check_file_name_and_content_type( - self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models3.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py index 3d9439fa89b..a75c4bd09be 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ..... import _model_base, models as _models +from ..... import _model_base, models as _models4 from ....._serialization import Deserializer, Serializer from ....._vendor import prepare_multipart_form_data from .....aio._configuration import MultiPartClientConfiguration @@ -62,7 +62,7 @@ def __init__(self, *args, **kwargs) -> None: ) @overload - async def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + async def json_array_and_file_array(self, body: _models4.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -84,7 +84,7 @@ async def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: """ async def json_array_and_file_array( - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + self, body: Union[_models4.ComplexHttpPartsModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py index cfe42f37966..4e27eb0f486 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ...... import _model_base, models as _models +from ...... import _model_base, models as _models5 from ......_serialization import Deserializer, Serializer from ......_vendor import prepare_multipart_form_data from ......aio._configuration import MultiPartClientConfiguration @@ -58,7 +58,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def image_jpeg_content_type( - self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any + self, body: _models5.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -81,7 +81,7 @@ async def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def image_jpeg_content_type( - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models5.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -135,7 +135,7 @@ async def image_jpeg_content_type( @overload async def required_content_type( - self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any + self, body: _models5.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -158,7 +158,7 @@ async def required_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def required_content_type( - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models5.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -212,7 +212,7 @@ async def required_content_type( @overload async def optional_content_type( - self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any + self, body: _models5.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -235,7 +235,7 @@ async def optional_content_type(self, body: JSON, **kwargs: Any) -> None: """ async def optional_content_type( - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models5.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py index 1b1f8d4feb3..9bb28bc960e 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/contenttype/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ..... import _model_base, models as _models +from ..... import _model_base, models as _models4 from ....._configuration import MultiPartClientConfiguration from ....._serialization import Deserializer, Serializer from ....._vendor import prepare_multipart_form_data @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def image_jpeg_content_type(self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: + def image_jpeg_content_type(self, body: _models4.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -111,7 +111,7 @@ def image_jpeg_content_type(self, body: JSON, **kwargs: Any) -> None: """ def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models4.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -164,7 +164,7 @@ def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def required_content_type(self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: + def required_content_type(self, body: _models4.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -186,7 +186,7 @@ def required_content_type(self, body: JSON, **kwargs: Any) -> None: """ def required_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models4.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -239,7 +239,7 @@ def required_content_type( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def optional_content_type(self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: + def optional_content_type(self, body: _models4.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for optional content type. :param body: Required. @@ -261,7 +261,7 @@ def optional_content_type(self, body: JSON, **kwargs: Any) -> None: """ def optional_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any + self, body: Union[_models4.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py index 110cf0dc104..a6b3d03dd2e 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/aio/operations/_operations.py @@ -20,7 +20,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ... import models as _models +from ... import models as _models2 from ...... import _model_base from ......_serialization import Deserializer, Serializer from ......_vendor import prepare_multipart_form_data @@ -54,7 +54,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + async def float(self, body: _models2.FloatRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Required. @@ -75,7 +75,7 @@ async def float(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def float(self, body: Union[_models.FloatRequest, JSON], **kwargs: Any) -> None: + async def float(self, body: Union[_models2.FloatRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Is either a FloatRequest type or a JSON type. Required. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py index 3e744752534..69c6252dc90 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/nonstring/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..... import _model_base from ....._configuration import MultiPartClientConfiguration from ....._serialization import Deserializer, Serializer @@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def float(self, body: _models.FloatRequest, **kwargs: Any) -> None: + def float(self, body: _models1.FloatRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for non string. :param body: Required. @@ -88,7 +88,7 @@ def float(self, body: JSON, **kwargs: Any) -> None: """ def float( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FloatRequest, JSON], **kwargs: Any + self, body: Union[_models1.FloatRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for non string. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py index 45de075f98b..583437e6856 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/httpparts/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import _model_base, models as _models +from .... import _model_base, models as _models3 from ...._configuration import MultiPartClientConfiguration from ...._serialization import Deserializer, Serializer from ...._vendor import prepare_multipart_form_data @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs): ) @overload - def json_array_and_file_array(self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: + def json_array_and_file_array(self, body: _models3.ComplexHttpPartsModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -98,7 +98,7 @@ def json_array_and_file_array(self, body: JSON, **kwargs: Any) -> None: """ def json_array_and_file_array( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + self, body: Union[_models3.ComplexHttpPartsModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py index a6af8a771f7..a4622e9107b 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import _model_base, models as _models +from ... import _model_base, models as _models2 from ..._configuration import MultiPartClientConfiguration from ..._serialization import Deserializer, Serializer from ..._vendor import FileType, prepare_multipart_form_data @@ -125,7 +125,7 @@ def __init__(self, *args, **kwargs): self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) @overload - def basic(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: + def basic(self, body: _models2.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -147,7 +147,7 @@ def basic(self, body: JSON, **kwargs: Any) -> None: """ def basic( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models2.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -199,7 +199,7 @@ def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def file_array_and_basic(self, body: _models.ComplexPartsRequest, **kwargs: Any) -> None: + def file_array_and_basic(self, body: _models2.ComplexPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -221,7 +221,7 @@ def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: """ def file_array_and_basic( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any + self, body: Union[_models2.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -273,7 +273,7 @@ def file_array_and_basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def json_part(self, body: _models.JsonPartRequest, **kwargs: Any) -> None: + def json_part(self, body: _models2.JsonPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. :param body: Required. @@ -295,7 +295,7 @@ def json_part(self, body: JSON, **kwargs: Any) -> None: """ def json_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.JsonPartRequest, JSON], **kwargs: Any + self, body: Union[_models2.JsonPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains json part and binary part. @@ -347,7 +347,7 @@ def json_part( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def binary_array_parts(self, body: _models.BinaryArrayPartsRequest, **kwargs: Any) -> None: + def binary_array_parts(self, body: _models2.BinaryArrayPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -369,7 +369,7 @@ def binary_array_parts(self, body: JSON, **kwargs: Any) -> None: """ def binary_array_parts( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BinaryArrayPartsRequest, JSON], **kwargs: Any + self, body: Union[_models2.BinaryArrayPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. @@ -421,7 +421,7 @@ def binary_array_parts( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def multi_binary_parts(self, body: _models.MultiBinaryPartsRequest, **kwargs: Any) -> None: + def multi_binary_parts(self, body: _models2.MultiBinaryPartsRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. :param body: Required. @@ -443,7 +443,7 @@ def multi_binary_parts(self, body: JSON, **kwargs: Any) -> None: """ def multi_binary_parts( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.MultiBinaryPartsRequest, JSON], **kwargs: Any + self, body: Union[_models2.MultiBinaryPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for scenario contains multi binary parts. @@ -495,7 +495,7 @@ def multi_binary_parts( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def check_file_name_and_content_type(self, body: _models.MultiPartRequest, **kwargs: Any) -> None: + def check_file_name_and_content_type(self, body: _models2.MultiPartRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. :param body: Required. @@ -517,7 +517,7 @@ def check_file_name_and_content_type(self, body: JSON, **kwargs: Any) -> None: """ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.MultiPartRequest, JSON], **kwargs: Any + self, body: Union[_models2.MultiPartRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py index 5c5a753fbb6..c0b10e3e9ff 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from .... import models as _models +from .... import models as _models3 from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import PageableClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: + def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: """link. :return: An iterator like instance of Pet @@ -67,7 +67,7 @@ def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -104,7 +104,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, AsyncList(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index 5b11ec9ae6a..6625be09122 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -21,7 +21,7 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse -from ..... import models as _models +from ..... import models as _models4 from ....._model_base import _deserialize from ....._serialization import Deserializer, Serializer from .....aio._configuration import PageableClientConfiguration @@ -58,12 +58,10 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def request_query_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_query_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -75,7 +73,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -85,43 +83,30 @@ def request_query_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -136,12 +121,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) def request_header_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_header_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -153,7 +136,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -163,43 +146,30 @@ def request_header_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -214,12 +184,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) def request_query_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_query_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -231,7 +199,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -241,43 +209,30 @@ def request_query_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -292,12 +247,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) def request_header_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models4.Pet"]: """request_header_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -309,7 +262,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models4.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -319,43 +272,30 @@ def request_header_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models4.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 30eeb20e5a6..3f38788349a 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .... import models as _models +from .... import models as _models3 from ...._configuration import PageableClientConfiguration from ...._model_base import _deserialize from ...._serialization import Deserializer, Serializer @@ -157,12 +157,10 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def request_query_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_query_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -174,7 +172,7 @@ def request_query_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -184,43 +182,30 @@ def request_query_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("nextToken") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -235,12 +220,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def request_header_response_body( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_header_response_body. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -252,7 +235,7 @@ def request_header_response_body( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -262,43 +245,30 @@ def request_header_response_body( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("nextToken") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -313,12 +283,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def request_query_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_query_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -330,7 +298,7 @@ def request_query_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -340,43 +308,30 @@ def request_query_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) @@ -391,12 +346,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def request_header_response_header( - self, *, token: Optional[str] = None, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Pet"]: + self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models3.Pet"]: """request_header_response_header. - :keyword token: Default value is None. - :paramtype token: str :keyword foo: Default value is None. :paramtype foo: str :keyword bar: Default value is None. @@ -408,7 +361,7 @@ def request_header_response_header( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models3.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -418,43 +371,30 @@ def request_header_response_header( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( - token=token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - + def prepare_request(_continuation_token=None): + + _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( + token=_continuation_token, + foo=foo, + bar=bar, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) _stream = False pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py index db18a057bdd..f1f02e515e6 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -22,7 +22,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ..._configuration import PageableClientConfiguration from ..._model_base import _deserialize from ..._serialization import Deserializer, Serializer @@ -74,7 +74,7 @@ def __init__(self, *args, **kwargs): self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: + def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: """link. :return: An iterator like instance of Pet @@ -84,7 +84,7 @@ def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) + cls: ClsType[List[_models2.Pet]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -121,7 +121,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized["pets"]) + list_of_elem = _deserialize(List[_models2.Pet], deserialized.get("pets", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("next") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py index c8af34e7982..deb729c5934 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/aio/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder, _deserialize from ...._serialization import Deserializer, Serializer from ....aio._configuration import JsonClientConfiguration @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def send( - self, body: _models.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """send. @@ -101,7 +101,7 @@ async def send(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def send(self, body: Union[_models.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def send(self, body: Union[_models2.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any) -> None: """send. :param body: Is one of the following types: JsonEncodedNameModel, JSON, IO[bytes] Required. @@ -154,7 +154,7 @@ async def send(self, body: Union[_models.JsonEncodedNameModel, JSON, IO[bytes]], if cls: return cls(pipeline_response, None, {}) # type: ignore - async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: + async def get(self, **kwargs: Any) -> _models2.JsonEncodedNameModel: """get. :return: JsonEncodedNameModel. The JsonEncodedNameModel is compatible with MutableMapping @@ -172,7 +172,7 @@ async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.JsonEncodedNameModel] = kwargs.pop("cls", None) + cls: ClsType[_models2.JsonEncodedNameModel] = kwargs.pop("cls", None) _request = build_property_get_request( headers=_headers, @@ -200,7 +200,7 @@ async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.JsonEncodedNameModel, response.json()) + deserialized = _deserialize(_models2.JsonEncodedNameModel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py index cc4e4d32208..12bb514d9c5 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/property/operations/_operations.py @@ -25,7 +25,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import JsonClientConfiguration from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs): @overload def send( - self, body: _models.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.JsonEncodedNameModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """send. @@ -132,7 +132,7 @@ def send(self, body: IO[bytes], *, content_type: str = "application/json", **kwa """ def send( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.JsonEncodedNameModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """send. @@ -186,7 +186,7 @@ def send( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore - def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: + def get(self, **kwargs: Any) -> _models1.JsonEncodedNameModel: """get. :return: JsonEncodedNameModel. The JsonEncodedNameModel is compatible with MutableMapping @@ -204,7 +204,7 @@ def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.JsonEncodedNameModel] = kwargs.pop("cls", None) + cls: ClsType[_models1.JsonEncodedNameModel] = kwargs.pop("cls", None) _request = build_property_get_request( headers=_headers, @@ -232,7 +232,7 @@ def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.JsonEncodedNameModel, response.json()) + deserialized = _deserialize(_models1.JsonEncodedNameModel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py index 32ae84db670..921cdbbd1fd 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/aio/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpecialWordsClientConfiguration @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @overload async def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.SameAsModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """same_as_model. @@ -99,7 +99,7 @@ async def same_as_model(self, body: IO[bytes], *, content_type: str = "applicati :raises ~corehttp.exceptions.HttpResponseError: """ - async def same_as_model(self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def same_as_model(self, body: Union[_models2.SameAsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """same_as_model. :param body: Is one of the following types: SameAsModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py index e2aff5d9d8a..85a195de972 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/modelproperties/operations/_operations.py @@ -23,7 +23,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import SpecialWordsClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -73,7 +73,7 @@ def __init__(self, *args, **kwargs): @overload def same_as_model( - self, body: _models.SameAsModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.SameAsModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """same_as_model. @@ -116,7 +116,7 @@ def same_as_model(self, body: IO[bytes], *, content_type: str = "application/jso """ def same_as_model( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.SameAsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.SameAsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """same_as_model. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py index 07567462188..c79d16826c7 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/aio/operations/_operations.py @@ -24,7 +24,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models2 from ...._model_base import SdkJSONEncoder from ...._serialization import Deserializer, Serializer from ....aio._configuration import SpecialWordsClientConfiguration @@ -91,7 +91,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_and(self, body: _models2.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_and. :param body: Required. @@ -132,7 +132,7 @@ async def with_and(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_and(self, body: Union[_models2.AndModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_and. :param body: Is one of the following types: AndModel, JSON, IO[bytes] Required. @@ -186,7 +186,7 @@ async def with_and(self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwarg return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_as(self, body: _models2.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_as. :param body: Required. @@ -227,7 +227,7 @@ async def with_as(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_as(self, body: Union[_models2.AsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_as. :param body: Is one of the following types: AsModel, JSON, IO[bytes] Required. @@ -282,7 +282,7 @@ async def with_as(self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: @overload async def with_assert( - self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.AssertModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_assert. @@ -324,7 +324,7 @@ async def with_assert(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_assert(self, body: Union[_models2.AssertModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_assert. :param body: Is one of the following types: AssertModel, JSON, IO[bytes] Required. @@ -379,7 +379,7 @@ async def with_assert(self, body: Union[_models.AssertModel, JSON, IO[bytes]], * @overload async def with_async( - self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.AsyncModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_async. @@ -421,7 +421,7 @@ async def with_async(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_async(self, body: Union[_models2.AsyncModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_async. :param body: Is one of the following types: AsyncModel, JSON, IO[bytes] Required. @@ -476,7 +476,7 @@ async def with_async(self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **k @overload async def with_await( - self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.AwaitModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_await. @@ -518,7 +518,7 @@ async def with_await(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_await(self, body: Union[_models2.AwaitModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_await. :param body: Is one of the following types: AwaitModel, JSON, IO[bytes] Required. @@ -573,7 +573,7 @@ async def with_await(self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **k @overload async def with_break( - self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.BreakModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_break. @@ -615,7 +615,7 @@ async def with_break(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_break(self, body: Union[_models2.BreakModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_break. :param body: Is one of the following types: BreakModel, JSON, IO[bytes] Required. @@ -670,7 +670,7 @@ async def with_break(self, body: Union[_models.BreakModel, JSON, IO[bytes]], **k @overload async def with_class( - self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ClassModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_class. @@ -712,7 +712,7 @@ async def with_class(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_class(self, body: Union[_models2.ClassModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_class. :param body: Is one of the following types: ClassModel, JSON, IO[bytes] Required. @@ -767,7 +767,7 @@ async def with_class(self, body: Union[_models.ClassModel, JSON, IO[bytes]], **k @overload async def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.Constructor, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_constructor. @@ -809,7 +809,7 @@ async def with_constructor(self, body: IO[bytes], *, content_type: str = "applic :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_constructor(self, body: Union[_models2.Constructor, JSON, IO[bytes]], **kwargs: Any) -> None: """with_constructor. :param body: Is one of the following types: Constructor, JSON, IO[bytes] Required. @@ -864,7 +864,7 @@ async def with_constructor(self, body: Union[_models.Constructor, JSON, IO[bytes @overload async def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ContinueModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_continue. @@ -906,7 +906,7 @@ async def with_continue(self, body: IO[bytes], *, content_type: str = "applicati :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_continue(self, body: Union[_models2.ContinueModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_continue. :param body: Is one of the following types: ContinueModel, JSON, IO[bytes] Required. @@ -960,7 +960,7 @@ async def with_continue(self, body: Union[_models.ContinueModel, JSON, IO[bytes] return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_def(self, body: _models2.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_def. :param body: Required. @@ -1001,7 +1001,7 @@ async def with_def(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_def(self, body: Union[_models2.DefModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_def. :param body: Is one of the following types: DefModel, JSON, IO[bytes] Required. @@ -1055,7 +1055,7 @@ async def with_def(self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwarg return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_del(self, body: _models2.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_del. :param body: Required. @@ -1096,7 +1096,7 @@ async def with_del(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_del(self, body: Union[_models2.DelModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_del. :param body: Is one of the following types: DelModel, JSON, IO[bytes] Required. @@ -1151,7 +1151,7 @@ async def with_del(self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwarg @overload async def with_elif( - self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ElifModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_elif. @@ -1193,7 +1193,7 @@ async def with_elif(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_elif(self, body: Union[_models2.ElifModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_elif. :param body: Is one of the following types: ElifModel, JSON, IO[bytes] Required. @@ -1248,7 +1248,7 @@ async def with_elif(self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwa @overload async def with_else( - self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ElseModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_else. @@ -1290,7 +1290,7 @@ async def with_else(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_else(self, body: Union[_models2.ElseModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_else. :param body: Is one of the following types: ElseModel, JSON, IO[bytes] Required. @@ -1345,7 +1345,7 @@ async def with_else(self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwa @overload async def with_except( - self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ExceptModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_except. @@ -1387,7 +1387,7 @@ async def with_except(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_except(self, body: Union[_models2.ExceptModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_except. :param body: Is one of the following types: ExceptModel, JSON, IO[bytes] Required. @@ -1442,7 +1442,7 @@ async def with_except(self, body: Union[_models.ExceptModel, JSON, IO[bytes]], * @overload async def with_exec( - self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ExecModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_exec. @@ -1484,7 +1484,7 @@ async def with_exec(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_exec(self, body: Union[_models2.ExecModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_exec. :param body: Is one of the following types: ExecModel, JSON, IO[bytes] Required. @@ -1539,7 +1539,7 @@ async def with_exec(self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwa @overload async def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.FinallyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_finally. @@ -1581,7 +1581,7 @@ async def with_finally(self, body: IO[bytes], *, content_type: str = "applicatio :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_finally(self, body: Union[_models2.FinallyModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_finally. :param body: Is one of the following types: FinallyModel, JSON, IO[bytes] Required. @@ -1635,7 +1635,7 @@ async def with_finally(self, body: Union[_models.FinallyModel, JSON, IO[bytes]], return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_for(self, body: _models2.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_for. :param body: Required. @@ -1676,7 +1676,7 @@ async def with_for(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_for(self, body: Union[_models2.ForModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_for. :param body: Is one of the following types: ForModel, JSON, IO[bytes] Required. @@ -1731,7 +1731,7 @@ async def with_for(self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwarg @overload async def with_from( - self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.FromModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_from. @@ -1773,7 +1773,7 @@ async def with_from(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_from(self, body: Union[_models2.FromModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_from. :param body: Is one of the following types: FromModel, JSON, IO[bytes] Required. @@ -1828,7 +1828,7 @@ async def with_from(self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwa @overload async def with_global( - self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.GlobalModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_global. @@ -1870,7 +1870,7 @@ async def with_global(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_global(self, body: Union[_models2.GlobalModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_global. :param body: Is one of the following types: GlobalModel, JSON, IO[bytes] Required. @@ -1924,7 +1924,7 @@ async def with_global(self, body: Union[_models.GlobalModel, JSON, IO[bytes]], * return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_if(self, body: _models2.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_if. :param body: Required. @@ -1965,7 +1965,7 @@ async def with_if(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_if(self, body: Union[_models2.IfModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_if. :param body: Is one of the following types: IfModel, JSON, IO[bytes] Required. @@ -2020,7 +2020,7 @@ async def with_if(self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: @overload async def with_import( - self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ImportModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_import. @@ -2062,7 +2062,7 @@ async def with_import(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_import(self, body: Union[_models2.ImportModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_import. :param body: Is one of the following types: ImportModel, JSON, IO[bytes] Required. @@ -2116,7 +2116,7 @@ async def with_import(self, body: Union[_models.ImportModel, JSON, IO[bytes]], * return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_in(self, body: _models2.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_in. :param body: Required. @@ -2157,7 +2157,7 @@ async def with_in(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_in(self, body: Union[_models2.InModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_in. :param body: Is one of the following types: InModel, JSON, IO[bytes] Required. @@ -2211,7 +2211,7 @@ async def with_in(self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_is(self, body: _models2.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_is. :param body: Required. @@ -2252,7 +2252,7 @@ async def with_is(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_is(self, body: Union[_models2.IsModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_is. :param body: Is one of the following types: IsModel, JSON, IO[bytes] Required. @@ -2307,7 +2307,7 @@ async def with_is(self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: @overload async def with_lambda( - self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.LambdaModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_lambda. @@ -2349,7 +2349,7 @@ async def with_lambda(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_lambda(self, body: Union[_models2.LambdaModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_lambda. :param body: Is one of the following types: LambdaModel, JSON, IO[bytes] Required. @@ -2403,7 +2403,7 @@ async def with_lambda(self, body: Union[_models.LambdaModel, JSON, IO[bytes]], * return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_not(self, body: _models2.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_not. :param body: Required. @@ -2444,7 +2444,7 @@ async def with_not(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_not(self, body: Union[_models2.NotModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_not. :param body: Is one of the following types: NotModel, JSON, IO[bytes] Required. @@ -2498,7 +2498,7 @@ async def with_not(self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwarg return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_or(self, body: _models2.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_or. :param body: Required. @@ -2539,7 +2539,7 @@ async def with_or(self, body: IO[bytes], *, content_type: str = "application/jso :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_or(self, body: Union[_models2.OrModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_or. :param body: Is one of the following types: OrModel, JSON, IO[bytes] Required. @@ -2594,7 +2594,7 @@ async def with_or(self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: @overload async def with_pass( - self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.PassModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_pass. @@ -2636,7 +2636,7 @@ async def with_pass(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_pass(self, body: Union[_models2.PassModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_pass. :param body: Is one of the following types: PassModel, JSON, IO[bytes] Required. @@ -2691,7 +2691,7 @@ async def with_pass(self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwa @overload async def with_raise( - self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.RaiseModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_raise. @@ -2733,7 +2733,7 @@ async def with_raise(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_raise(self, body: Union[_models2.RaiseModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_raise. :param body: Is one of the following types: RaiseModel, JSON, IO[bytes] Required. @@ -2788,7 +2788,7 @@ async def with_raise(self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **k @overload async def with_return( - self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.ReturnModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_return. @@ -2830,7 +2830,7 @@ async def with_return(self, body: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_return(self, body: Union[_models2.ReturnModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_return. :param body: Is one of the following types: ReturnModel, JSON, IO[bytes] Required. @@ -2884,7 +2884,7 @@ async def with_return(self, body: Union[_models.ReturnModel, JSON, IO[bytes]], * return cls(pipeline_response, None, {}) # type: ignore @overload - async def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def with_try(self, body: _models2.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_try. :param body: Required. @@ -2925,7 +2925,7 @@ async def with_try(self, body: IO[bytes], *, content_type: str = "application/js :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_try(self, body: Union[_models2.TryModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_try. :param body: Is one of the following types: TryModel, JSON, IO[bytes] Required. @@ -2980,7 +2980,7 @@ async def with_try(self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwarg @overload async def with_while( - self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.WhileModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_while. @@ -3022,7 +3022,7 @@ async def with_while(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_while(self, body: Union[_models2.WhileModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_while. :param body: Is one of the following types: WhileModel, JSON, IO[bytes] Required. @@ -3077,7 +3077,7 @@ async def with_while(self, body: Union[_models.WhileModel, JSON, IO[bytes]], **k @overload async def with_with( - self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.WithModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_with. @@ -3119,7 +3119,7 @@ async def with_with(self, body: IO[bytes], *, content_type: str = "application/j :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_with(self, body: Union[_models2.WithModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_with. :param body: Is one of the following types: WithModel, JSON, IO[bytes] Required. @@ -3174,7 +3174,7 @@ async def with_with(self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwa @overload async def with_yield( - self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models2.YieldModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_yield. @@ -3216,7 +3216,7 @@ async def with_yield(self, body: IO[bytes], *, content_type: str = "application/ :raises ~corehttp.exceptions.HttpResponseError: """ - async def with_yield(self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def with_yield(self, body: Union[_models2.YieldModel, JSON, IO[bytes]], **kwargs: Any) -> None: """with_yield. :param body: Is one of the following types: YieldModel, JSON, IO[bytes] Required. diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py index 8459e0f2bd5..a1b9c14e28d 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/models/operations/_operations.py @@ -24,7 +24,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models1 from ..._configuration import SpecialWordsClientConfiguration from ..._model_base import SdkJSONEncoder from ..._serialization import Deserializer, Serializer @@ -521,7 +521,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def with_and(self, body: _models.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_and(self, body: _models1.AndModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_and. :param body: Required. @@ -563,7 +563,7 @@ def with_and(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_and( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AndModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.AndModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_and. @@ -618,7 +618,7 @@ def with_and( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_as(self, body: _models.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_as(self, body: _models1.AsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_as. :param body: Required. @@ -660,7 +660,7 @@ def with_as(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_as( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.AsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_as. @@ -715,7 +715,7 @@ def with_as( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_assert(self, body: _models.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_assert(self, body: _models1.AssertModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_assert. :param body: Required. @@ -757,7 +757,7 @@ def with_assert(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_assert( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AssertModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.AssertModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_assert. @@ -812,7 +812,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_async(self, body: _models.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_async(self, body: _models1.AsyncModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_async. :param body: Required. @@ -854,7 +854,7 @@ def with_async(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_async( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AsyncModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.AsyncModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_async. @@ -909,7 +909,7 @@ def with_async( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_await(self, body: _models.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_await(self, body: _models1.AwaitModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_await. :param body: Required. @@ -951,7 +951,7 @@ def with_await(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_await( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.AwaitModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.AwaitModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_await. @@ -1006,7 +1006,7 @@ def with_await( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_break(self, body: _models.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_break(self, body: _models1.BreakModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_break. :param body: Required. @@ -1048,7 +1048,7 @@ def with_break(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_break( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.BreakModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.BreakModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_break. @@ -1103,7 +1103,7 @@ def with_break( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_class(self, body: _models.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_class(self, body: _models1.ClassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_class. :param body: Required. @@ -1145,7 +1145,7 @@ def with_class(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_class( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ClassModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ClassModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_class. @@ -1201,7 +1201,7 @@ def with_class( # pylint: disable=inconsistent-return-statements @overload def with_constructor( - self, body: _models.Constructor, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.Constructor, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_constructor. @@ -1244,7 +1244,7 @@ def with_constructor(self, body: IO[bytes], *, content_type: str = "application/ """ def with_constructor( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.Constructor, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.Constructor, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_constructor. @@ -1300,7 +1300,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements @overload def with_continue( - self, body: _models.ContinueModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.ContinueModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_continue. @@ -1343,7 +1343,7 @@ def with_continue(self, body: IO[bytes], *, content_type: str = "application/jso """ def with_continue( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ContinueModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ContinueModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_continue. @@ -1398,7 +1398,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_def(self, body: _models.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_def(self, body: _models1.DefModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_def. :param body: Required. @@ -1440,7 +1440,7 @@ def with_def(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_def( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DefModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.DefModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_def. @@ -1495,7 +1495,7 @@ def with_def( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_del(self, body: _models.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_del(self, body: _models1.DelModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_del. :param body: Required. @@ -1537,7 +1537,7 @@ def with_del(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_del( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.DelModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.DelModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_del. @@ -1592,7 +1592,7 @@ def with_del( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_elif(self, body: _models.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_elif(self, body: _models1.ElifModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_elif. :param body: Required. @@ -1634,7 +1634,7 @@ def with_elif(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_elif( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElifModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ElifModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_elif. @@ -1689,7 +1689,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_else(self, body: _models.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_else(self, body: _models1.ElseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_else. :param body: Required. @@ -1731,7 +1731,7 @@ def with_else(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_else( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ElseModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ElseModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_else. @@ -1786,7 +1786,7 @@ def with_else( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_except(self, body: _models.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_except(self, body: _models1.ExceptModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_except. :param body: Required. @@ -1828,7 +1828,7 @@ def with_except(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_except( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExceptModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ExceptModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_except. @@ -1883,7 +1883,7 @@ def with_except( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_exec(self, body: _models.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_exec(self, body: _models1.ExecModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_exec. :param body: Required. @@ -1925,7 +1925,7 @@ def with_exec(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_exec( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ExecModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ExecModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_exec. @@ -1981,7 +1981,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements @overload def with_finally( - self, body: _models.FinallyModel, *, content_type: str = "application/json", **kwargs: Any + self, body: _models1.FinallyModel, *, content_type: str = "application/json", **kwargs: Any ) -> None: """with_finally. @@ -2024,7 +2024,7 @@ def with_finally(self, body: IO[bytes], *, content_type: str = "application/json """ def with_finally( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FinallyModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.FinallyModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_finally. @@ -2079,7 +2079,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_for(self, body: _models.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_for(self, body: _models1.ForModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_for. :param body: Required. @@ -2121,7 +2121,7 @@ def with_for(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_for( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ForModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ForModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_for. @@ -2176,7 +2176,7 @@ def with_for( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_from(self, body: _models.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_from(self, body: _models1.FromModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_from. :param body: Required. @@ -2218,7 +2218,7 @@ def with_from(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_from( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.FromModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.FromModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_from. @@ -2273,7 +2273,7 @@ def with_from( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_global(self, body: _models.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_global(self, body: _models1.GlobalModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_global. :param body: Required. @@ -2315,7 +2315,7 @@ def with_global(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_global( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.GlobalModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.GlobalModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_global. @@ -2370,7 +2370,7 @@ def with_global( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_if(self, body: _models.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_if(self, body: _models1.IfModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_if. :param body: Required. @@ -2412,7 +2412,7 @@ def with_if(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_if( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IfModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.IfModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_if. @@ -2467,7 +2467,7 @@ def with_if( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_import(self, body: _models.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_import(self, body: _models1.ImportModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_import. :param body: Required. @@ -2509,7 +2509,7 @@ def with_import(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_import( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ImportModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ImportModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_import. @@ -2564,7 +2564,7 @@ def with_import( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_in(self, body: _models.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_in(self, body: _models1.InModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_in. :param body: Required. @@ -2606,7 +2606,7 @@ def with_in(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_in( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.InModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.InModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_in. @@ -2661,7 +2661,7 @@ def with_in( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_is(self, body: _models.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_is(self, body: _models1.IsModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_is. :param body: Required. @@ -2703,7 +2703,7 @@ def with_is(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_is( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.IsModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.IsModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_is. @@ -2758,7 +2758,7 @@ def with_is( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_lambda(self, body: _models.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_lambda(self, body: _models1.LambdaModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_lambda. :param body: Required. @@ -2800,7 +2800,7 @@ def with_lambda(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_lambda( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.LambdaModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.LambdaModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_lambda. @@ -2855,7 +2855,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_not(self, body: _models.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_not(self, body: _models1.NotModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_not. :param body: Required. @@ -2897,7 +2897,7 @@ def with_not(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_not( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.NotModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.NotModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_not. @@ -2952,7 +2952,7 @@ def with_not( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_or(self, body: _models.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_or(self, body: _models1.OrModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_or. :param body: Required. @@ -2994,7 +2994,7 @@ def with_or(self, body: IO[bytes], *, content_type: str = "application/json", ** """ def with_or( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.OrModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.OrModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_or. @@ -3049,7 +3049,7 @@ def with_or( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_pass(self, body: _models.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_pass(self, body: _models1.PassModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_pass. :param body: Required. @@ -3091,7 +3091,7 @@ def with_pass(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_pass( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.PassModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.PassModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_pass. @@ -3146,7 +3146,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_raise(self, body: _models.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_raise(self, body: _models1.RaiseModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_raise. :param body: Required. @@ -3188,7 +3188,7 @@ def with_raise(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_raise( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.RaiseModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.RaiseModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_raise. @@ -3243,7 +3243,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_return(self, body: _models.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_return(self, body: _models1.ReturnModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_return. :param body: Required. @@ -3285,7 +3285,7 @@ def with_return(self, body: IO[bytes], *, content_type: str = "application/json" """ def with_return( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ReturnModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.ReturnModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_return. @@ -3340,7 +3340,7 @@ def with_return( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_try(self, body: _models.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_try(self, body: _models1.TryModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_try. :param body: Required. @@ -3382,7 +3382,7 @@ def with_try(self, body: IO[bytes], *, content_type: str = "application/json", * """ def with_try( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.TryModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.TryModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_try. @@ -3437,7 +3437,7 @@ def with_try( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_while(self, body: _models.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_while(self, body: _models1.WhileModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_while. :param body: Required. @@ -3479,7 +3479,7 @@ def with_while(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_while( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WhileModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.WhileModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_while. @@ -3534,7 +3534,7 @@ def with_while( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_with(self, body: _models.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_with(self, body: _models1.WithModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_with. :param body: Required. @@ -3576,7 +3576,7 @@ def with_with(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_with( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.WithModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.WithModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_with. @@ -3631,7 +3631,7 @@ def with_with( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def with_yield(self, body: _models.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: + def with_yield(self, body: _models1.YieldModel, *, content_type: str = "application/json", **kwargs: Any) -> None: """with_yield. :param body: Required. @@ -3673,7 +3673,7 @@ def with_yield(self, body: IO[bytes], *, content_type: str = "application/json", """ def with_yield( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.YieldModel, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models1.YieldModel, JSON, IO[bytes]], **kwargs: Any ) -> None: """with_yield. From ac94c40cb4b160346c66b8b09caf37b31e72b211 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 17 Mar 2025 08:35:50 +0000 Subject: [PATCH 05/13] update --- package.json | 16 +- packages/autorest.python/package.json | 6 +- .../typespec-python/scripts/eng/regenerate.ts | 2 - pnpm-lock.yaml | 4098 ++++++++--------- 4 files changed, 1977 insertions(+), 2145 deletions(-) diff --git a/package.json b/package.json index 9a3960aa409..50726074f12 100644 --- a/package.json +++ b/package.json @@ -33,18 +33,18 @@ "devDependencies": { "@actions/github": "6.0.0", "@chronus/chronus": "^0.12.1", - "@chronus/github": "^0.4.4", - "@eslint/js": "^9.11.1", + "@chronus/github": "^0.4.9", + "@eslint/js": "^9.22.0", "autorest": "~3.7.1", "cross-env": "^7.0.3", - "eslint": "^9.11.1", - "eslint-plugin-import": "^2.30.0", + "cspell": "^7.3.9", + "eslint": "^9.22.0", + "eslint-plugin-import": "^2.31.0", "eslint-plugin-unicorn": "^55.0.0", "prettier": "~3.3.3", - "syncpack": "^13.0.0", - "typescript": "~5.6.2", - "typescript-eslint": "^8.7.0", - "cspell": "^7.0.0" + "syncpack": "^13.0.3", + "typescript": "~5.6.3", + "typescript-eslint": "^8.26.1" }, "syncpack": { "dependencyTypes": [ diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 45971037109..240c42a996d 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,13 +29,13 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", "@autorest/system-requirements": "~1.0.2", + "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", "fs-extra": "~11.2.0", - "tsx": "~4.19.1" + "tsx": "~4.19.3" }, "devDependencies": { - "@microsoft.azure/autorest.testserver": "^3.3.50", + "@microsoft.azure/autorest.testserver": "^3.3.51", "chalk": "5.3.0", "typescript": "~5.1.6" }, diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 90bf8ed44e5..e56cb6906d2 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -102,7 +102,6 @@ const EMITTER_OPTIONS: Record | Record | Record=12.0.0'} @@ -250,20 +253,16 @@ packages: resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==} engines: {node: '>=18.0.0'} - '@azure/core-auth@1.8.0': - resolution: {integrity: sha512-YvFMowkXzLbXNM11yZtVLhUCmuG0ex7JKOH366ipjmHBhL3vpDcPAeWF+jf0X+jVXwFqo3UhsWUq4kH0ZPdu/g==} - engines: {node: '>=18.0.0'} - '@azure/core-auth@1.9.0': resolution: {integrity: sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==} engines: {node: '>=18.0.0'} - '@azure/core-client@1.9.2': - resolution: {integrity: sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==} + '@azure/core-client@1.9.3': + resolution: {integrity: sha512-/wGw8fJ4mdpJ1Cum7s1S+VQyXt1ihwKLzfabS1O/RDADnmzVc01dHn44qD0BvGH6KlZNzOMW95tEpKqhkCChPA==} engines: {node: '>=18.0.0'} - '@azure/core-http-compat@2.1.2': - resolution: {integrity: sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==} + '@azure/core-http-compat@2.2.0': + resolution: {integrity: sha512-1kW8ZhN0CfbNOG6C688z5uh2yrzALE7dDXHiR9dY4vt+EbhGZQSbjDa5bQd2rf3X2pdWMsXbqbArxUyeNdvtmg==} engines: {node: '>=18.0.0'} '@azure/core-lro@2.7.2': @@ -274,24 +273,20 @@ packages: resolution: {integrity: sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==} engines: {node: '>=18.0.0'} - '@azure/core-rest-pipeline@1.17.0': - resolution: {integrity: sha512-62Vv8nC+uPId3j86XJ0WI+sBf0jlqTqPUFCBNrGtlaUeQUIXWV/D8GE5A1d+Qx8H7OQojn2WguC8kChD6v0shA==} + '@azure/core-rest-pipeline@1.19.1': + resolution: {integrity: sha512-zHeoI3NCs53lLBbWNzQycjnYKsA1CVKlnzSNuSFcUDwBp8HHVObePxrM7HaX+Ha5Ks639H7chNC9HOaIhNS03w==} engines: {node: '>=18.0.0'} - '@azure/core-tracing@1.1.2': - resolution: {integrity: sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==} - engines: {node: '>=18.0.0'} - - '@azure/core-util@1.10.0': - resolution: {integrity: sha512-dqLWQsh9Nro1YQU+405POVtXnwrIVqPyfUzc4zXCbThTg7+vNNaiMkwbX9AMXKyoFYFClxmB3s25ZFr3+jZkww==} + '@azure/core-tracing@1.2.0': + resolution: {integrity: sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==} engines: {node: '>=18.0.0'} '@azure/core-util@1.11.0': resolution: {integrity: sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==} engines: {node: '>=18.0.0'} - '@azure/core-xml@1.4.3': - resolution: {integrity: sha512-D6G7FEmDiTctPKuWegX2WTrS1enKZwqYwdKTO6ZN6JMigcCehlT0/CYl+zWpI9vQ9frwwp7GQT3/owaEXgnOsA==} + '@azure/core-xml@1.4.5': + resolution: {integrity: sha512-gT4H8mTaSXRz7eGTuQyq1aIJnJqeXzpOe9Ay7Z3FrCouer14CbV3VzjnJrNrQfbBpGBLO9oy8BmrY75A0p53cA==} engines: {node: '>=18.0.0'} '@azure/identity@4.6.0': @@ -302,26 +297,22 @@ packages: resolution: {integrity: sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==} engines: {node: '>=18.0.0'} - '@azure/msal-browser@4.2.1': - resolution: {integrity: sha512-pJX+HNVxEEvxqj3xvnFKMi/Yb6jadwOWN2QkDagj2GV2XXxJg3qq5zkE+czVw6Cmf4QiXxct+J0WF23sE8vZyA==} + '@azure/msal-browser@4.7.0': + resolution: {integrity: sha512-H4AIPhIQVe1qW4+BJaitqod6UGQiXE3juj7q2ZBsOPjuZicQaqcbnBp2gCroF/icS0+TJ9rGuyCBJbjlAqVOGA==} engines: {node: '>=0.8.0'} '@azure/msal-common@14.16.0': resolution: {integrity: sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==} engines: {node: '>=0.8.0'} - '@azure/msal-common@15.1.1': - resolution: {integrity: sha512-bvLWYq9fleAcTJ6H+hfkG91On6vI/UhGyOB7Z6r0Bsa+KTL3zPtigmGCOJgdxrEklOYD88X9SehexLDH/5NRKQ==} + '@azure/msal-common@15.2.1': + resolution: {integrity: sha512-eZHtYE5OHDN0o2NahCENkczQ6ffGc0MoUSAI3hpwGpZBHJXaEQMMZPWtIx86da2L9w7uT+Tr/xgJbGwIkvTZTQ==} engines: {node: '>=0.8.0'} '@azure/msal-node@2.16.2': resolution: {integrity: sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==} engines: {node: '>=16'} - '@azure/storage-blob@12.25.0': - resolution: {integrity: sha512-oodouhA3nCCIh843tMMbxty3WqfNT+Vgzj3Xo5jqR9UPnzq3d7mzLjlHAYz7lW+b4km3SIgz+NAgztvhm7Z6kQ==} - engines: {node: '>=18.0.0'} - '@azure/storage-blob@12.26.0': resolution: {integrity: sha512-SriLPKezypIsiZ+TtlFfE46uuBIap2HeaQVS78e1P7rz5OSbq0rsd52WE1mC5f7vAeLiXqv7I7oRhL3WFZEw3Q==} engines: {node: '>=18.0.0'} @@ -330,10 +321,6 @@ packages: resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.9': resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} @@ -347,13 +334,13 @@ packages: engines: {node: '>=16.0.0'} hasBin: true - '@chronus/chronus@0.13.0': - resolution: {integrity: sha512-YmL77P2BV29Ec854TfmPtzyQBQvFfWwl5OsCqgFtJT3tPE2YIfF5q0hZHeVCkgTpHtdOfHKJzUheZBM6i2GWzw==} + '@chronus/chronus@0.17.0': + resolution: {integrity: sha512-i4ZnvCCNnB8/i+Xl+vVLizy15k5HDyAoTfvxmQEE9bAyOy78hlCxJDhGY1dOA1pVmLT3oq9kV2e4qbVAYsokBw==} engines: {node: '>=16.0.0'} hasBin: true - '@chronus/github@0.4.4': - resolution: {integrity: sha512-vAMCUnr0Ky+KoQEIFXPJ/rP8+Piw6DsSTB8fNQp8yqknHH+yQruJJr2vtG+MPmBz5/hhNJd5xwuUcl2Bdtau7Q==} + '@chronus/github@0.4.9': + resolution: {integrity: sha512-gyuZ0b1Q50qdB1wUve7zt/5d249lIxzaH0yWovX6BfKlEMHmHlVY4D3VG4j+doRB/M8gC97JfptK5SbRuboSdQ==} engines: {node: '>=16.0.0'} hasBin: true @@ -394,8 +381,8 @@ packages: '@cspell/dict-bash@4.2.0': resolution: {integrity: sha512-HOyOS+4AbCArZHs/wMxX/apRkjxg6NDWdt0jF9i9XkvJQUltMwEhyA2TWYjQ0kssBsnof+9amax2lhiZnh3kCg==} - '@cspell/dict-companies@3.1.12': - resolution: {integrity: sha512-99FxBNdLOQc3nVQ663Xh7JqDLbIy/AdqOecQ5bk3HpmXpSkoDvTT7XCUU5nQZvmFBrrQlXFKlRRYjLfTEOUDdA==} + '@cspell/dict-companies@3.1.14': + resolution: {integrity: sha512-iqo1Ce4L7h0l0GFSicm2wCLtfuymwkvgFGhmu9UHyuIcTbdFkDErH+m6lH3Ed+QuskJlpQ9dM7puMIGqUlVERw==} '@cspell/dict-cpp@5.1.23': resolution: {integrity: sha512-59VUam6bYWzn50j8FASWWLww0rBPA0PZfjMZBvvt0aqMpkvXzoJPnAAI4eDDSibPWVHKutjpqLmast+uMLHVsQ==} @@ -412,8 +399,8 @@ packages: '@cspell/dict-dart@2.3.0': resolution: {integrity: sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==} - '@cspell/dict-data-science@2.0.6': - resolution: {integrity: sha512-gOYKZOg358yhnnQfr1/f232REmjeIymXUHJdrLEMPirluv2rzMWvEBBazqRVQ++jMUNg9IduVI0v096ZWMDekA==} + '@cspell/dict-data-science@2.0.7': + resolution: {integrity: sha512-XhAkK+nSW6zmrnWzusmZ1BpYLc62AWYHZc2p17u4nE2Z9XG5DleG55PCZxXQTKz90pmwlhFM9AfpkJsYaBWATA==} '@cspell/dict-django@4.1.4': resolution: {integrity: sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==} @@ -433,11 +420,11 @@ packages: '@cspell/dict-en-gb@1.1.33': resolution: {integrity: sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==} - '@cspell/dict-en_us@4.3.29': - resolution: {integrity: sha512-7kHP0sJ271oS5RqakxvhWvHFoCUFCBDV6+cgIRIpKwW0aYVB4F2AwElGsdeE/XEmihhYUje7e/e6X3IEWHrcrQ==} + '@cspell/dict-en_us@4.3.34': + resolution: {integrity: sha512-ewJXNV7Nk5vxbGvHvxYLDGoXN0Lq5sfSgX8SAlcYL+2bZ7r25nNOLHou5hdFlNgvviGTx/SFPlVKjdjVJlblgA==} - '@cspell/dict-filetypes@3.0.10': - resolution: {integrity: sha512-JEN3627joBVtpa1yfkdN9vz1Z129PoKGHBKjXCEziJvf2Zt1LeULWYYYg/O6pzRR4yzRa5YbXDTuyrN7vX7DFg==} + '@cspell/dict-filetypes@3.0.11': + resolution: {integrity: sha512-bBtCHZLo7MiSRUqx5KEiPdGOmXIlDGY+L7SJEtRWZENpAKE+96rT7hj+TUUYWBbCzheqHr0OXZJFEKDgsG/uZg==} '@cspell/dict-fonts@4.0.4': resolution: {integrity: sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==} @@ -445,8 +432,8 @@ packages: '@cspell/dict-fsharp@1.1.0': resolution: {integrity: sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==} - '@cspell/dict-fullstack@3.2.3': - resolution: {integrity: sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==} + '@cspell/dict-fullstack@3.2.6': + resolution: {integrity: sha512-cSaq9rz5RIU9j+0jcF2vnKPTQjxGXclntmoNp4XB7yFX2621PxJcekGjwf/lN5heJwVxGLL9toR0CBlGKwQBgA==} '@cspell/dict-gaming-terms@1.1.0': resolution: {integrity: sha512-46AnDs9XkgJ2f1Sqol1WgfJ8gOqp60fojpc9Wxch7x+BA63g4JfMV5/M5x0sI0TLlLY8EBSglcr8wQF/7C80AQ==} @@ -454,8 +441,8 @@ packages: '@cspell/dict-git@2.0.0': resolution: {integrity: sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w==} - '@cspell/dict-golang@6.0.18': - resolution: {integrity: sha512-Mt+7NwfodDwUk7423DdaQa0YaA+4UoV3XSxQwZioqjpFBCuxfvvv4l80MxCTAAbK6duGj0uHbGTwpv8fyKYPKg==} + '@cspell/dict-golang@6.0.19': + resolution: {integrity: sha512-VS+oinB2/CbgmHE06kMJlj52OVMZM0S2EEXph3oaroNTgTuclSwdFylQmOEjquZi55kW+n3FM9MyWXiitB7Dtg==} '@cspell/dict-haskell@4.0.5': resolution: {integrity: sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==} @@ -487,8 +474,8 @@ packages: '@cspell/dict-node@4.0.3': resolution: {integrity: sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==} - '@cspell/dict-npm@5.1.22': - resolution: {integrity: sha512-fZBTn8QHr8pAv1/I14CmdDWpVkovCfYpSYiGfV1SZkOjrsKLzPxsP84eaP3RijbFtYj3GMplVN27FR3H5oHfiw==} + '@cspell/dict-npm@5.1.30': + resolution: {integrity: sha512-qRMJZFz4FBPECH5rGQN9p2Ld6nfpSaPFQvlG6V2RowWcrJQqF4RFmLUNuRQpvndpSeIUo32yX1hxb7AT45ARCQ==} '@cspell/dict-php@4.0.14': resolution: {integrity: sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==} @@ -496,17 +483,17 @@ packages: '@cspell/dict-powershell@5.0.14': resolution: {integrity: sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==} - '@cspell/dict-public-licenses@2.0.12': - resolution: {integrity: sha512-obreJMVbz8ZrXyc60PcS/B2FwXaO3AWPO2x50zrI/n4UDuBr/UdPb6M1q++6c08n+151I35GEx52xRFiToSg4g==} + '@cspell/dict-public-licenses@2.0.13': + resolution: {integrity: sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==} - '@cspell/dict-python@4.2.14': - resolution: {integrity: sha512-NZ/rsTH5gqTlEwbSg0vn5b1TsyzrUvA6ykwCVCwsVDdlQAS82cyDsF9JqHp8S4d6PFykmkfSxtAXYyOUr0KCbg==} + '@cspell/dict-python@4.2.16': + resolution: {integrity: sha512-LkQssFt1hPOWXIQiD8ScTkz/41RL7Ti0V/2ytUzEW82dc0atIEksrBg8MuOjWXktp0Dk5tDwRLgmIvhV3CFFOA==} '@cspell/dict-r@2.1.0': resolution: {integrity: sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==} - '@cspell/dict-ruby@5.0.7': - resolution: {integrity: sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==} + '@cspell/dict-ruby@5.0.8': + resolution: {integrity: sha512-ixuTneU0aH1cPQRbWJvtvOntMFfeQR2KxT8LuAv5jBKqQWIHSxzGlp+zX3SVyoeR0kOWiu64/O5Yn836A5yMcQ==} '@cspell/dict-rust@4.0.11': resolution: {integrity: sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==} @@ -546,341 +533,226 @@ packages: '@dabh/diagnostics@2.0.3': resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} - '@effect/schema@0.71.1': - resolution: {integrity: sha512-XvFttkuBUL3s4ofZ+OVE4Pagb4wsPG8laSS8iO5lVI9Yt1zIM49uxlYIA2BJ45jjS3MdplUepC0NilotKnjU2A==} + '@effect/schema@0.75.5': + resolution: {integrity: sha512-TQInulTVCuF+9EIbJpyLP6dvxbQJMphrnRqgexm/Ze39rSjfhJuufF7XvU3SxTgg3HnL7B/kpORTJbHhlE6thw==} + deprecated: this package has been merged into the main effect package peerDependencies: - effect: ^3.6.5 + effect: ^3.9.2 - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - - '@esbuild/aix-ppc64@0.23.1': - resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + '@esbuild/aix-ppc64@0.25.1': + resolution: {integrity: sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm64@0.23.1': - resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + '@esbuild/android-arm64@0.25.1': + resolution: {integrity: sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - - '@esbuild/android-arm@0.23.1': - resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + '@esbuild/android-arm@0.25.1': + resolution: {integrity: sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - - '@esbuild/android-x64@0.23.1': - resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + '@esbuild/android-x64@0.25.1': + resolution: {integrity: sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-arm64@0.23.1': - resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + '@esbuild/darwin-arm64@0.25.1': + resolution: {integrity: sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - - '@esbuild/darwin-x64@0.23.1': - resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + '@esbuild/darwin-x64@0.25.1': + resolution: {integrity: sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-arm64@0.23.1': - resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + '@esbuild/freebsd-arm64@0.25.1': + resolution: {integrity: sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.23.1': - resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + '@esbuild/freebsd-x64@0.25.1': + resolution: {integrity: sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm64@0.23.1': - resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + '@esbuild/linux-arm64@0.25.1': + resolution: {integrity: sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-arm@0.23.1': - resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + '@esbuild/linux-arm@0.25.1': + resolution: {integrity: sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-ia32@0.23.1': - resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + '@esbuild/linux-ia32@0.25.1': + resolution: {integrity: sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-loong64@0.23.1': - resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + '@esbuild/linux-loong64@0.25.1': + resolution: {integrity: sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-mips64el@0.23.1': - resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + '@esbuild/linux-mips64el@0.25.1': + resolution: {integrity: sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-ppc64@0.23.1': - resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + '@esbuild/linux-ppc64@0.25.1': + resolution: {integrity: sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-riscv64@0.23.1': - resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + '@esbuild/linux-riscv64@0.25.1': + resolution: {integrity: sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-s390x@0.23.1': - resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + '@esbuild/linux-s390x@0.25.1': + resolution: {integrity: sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - - '@esbuild/linux-x64@0.23.1': - resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + '@esbuild/linux-x64@0.25.1': + resolution: {integrity: sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/netbsd-arm64@0.25.1': + resolution: {integrity: sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==} + engines: {node: '>=18'} + cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.23.1': - resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + '@esbuild/netbsd-x64@0.25.1': + resolution: {integrity: sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.23.1': - resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + '@esbuild/openbsd-arm64@0.25.1': + resolution: {integrity: sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.23.1': - resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + '@esbuild/openbsd-x64@0.25.1': + resolution: {integrity: sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - - '@esbuild/sunos-x64@0.23.1': - resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + '@esbuild/sunos-x64@0.25.1': + resolution: {integrity: sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-arm64@0.23.1': - resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + '@esbuild/win32-arm64@0.25.1': + resolution: {integrity: sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-ia32@0.23.1': - resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + '@esbuild/win32-ia32@0.25.1': + resolution: {integrity: sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - - '@esbuild/win32-x64@0.23.1': - resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + '@esbuild/win32-x64@0.25.1': + resolution: {integrity: sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.5.1': + resolution: {integrity: sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.18.0': - resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} + '@eslint/config-array@0.19.2': + resolution: {integrity: sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.6.0': - resolution: {integrity: sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==} + '@eslint/config-helpers@0.1.0': + resolution: {integrity: sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + '@eslint/core@0.12.0': + resolution: {integrity: sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.11.1': - resolution: {integrity: sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==} + '@eslint/eslintrc@3.3.0': + resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.4': - resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + '@eslint/js@9.22.0': + resolution: {integrity: sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.0': - resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + '@eslint/object-schema@2.1.6': + resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/plugin-kit@0.2.7': + resolution: {integrity: sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + engines: {node: '>=18.18.0'} + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/retry@0.3.0': - resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + '@humanwhocodes/retry@0.3.1': + resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} - '@inquirer/checkbox@4.1.2': - resolution: {integrity: sha512-PL9ixC5YsPXzXhAZFUPmkXGxfgjkdfZdPEPPmt4kFwQ4LBMDG9n/nHXYRGGZSKZJs+d1sGKWgS2GiPzVRKUdtQ==} + '@humanwhocodes/retry@0.4.2': + resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==} + engines: {node: '>=18.18'} + + '@inquirer/checkbox@4.1.4': + resolution: {integrity: sha512-d30576EZdApjAMceijXA5jDzRQHT/MygbC+J8I7EqA6f/FRpYxlRtRJbHF8gHeWYeSdOuTEJqonn7QLB1ELezA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -888,8 +760,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.6': - resolution: {integrity: sha512-6ZXYK3M1XmaVBZX6FCfChgtponnL0R6I7k8Nu+kaoNkT828FVZTcca1MqmWQipaW2oNREQl5AaPCUOOCVNdRMw==} + '@inquirer/confirm@5.1.8': + resolution: {integrity: sha512-dNLWCYZvXDjO3rnQfk2iuJNL4Ivwz/T2+C3+WnNfJKsNGSuOs3wAo2F6e0p946gtSAk31nZMfW+MRmYaplPKsg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -897,8 +769,8 @@ packages: '@types/node': optional: true - '@inquirer/core@10.1.7': - resolution: {integrity: sha512-AA9CQhlrt6ZgiSy6qoAigiA1izOa751ugX6ioSjqgJ+/Gd+tEN/TORk5sUYNjXuHWfW0r1n/a6ak4u/NqHHrtA==} + '@inquirer/core@10.1.9': + resolution: {integrity: sha512-sXhVB8n20NYkUBfDYgizGHlpRVaCRjtuzNZA6xpALIUbkgfd2Hjz+DfEN6+h1BRnuxw0/P4jCIMjMsEOAMwAJw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -906,8 +778,8 @@ packages: '@types/node': optional: true - '@inquirer/editor@4.2.7': - resolution: {integrity: sha512-gktCSQtnSZHaBytkJKMKEuswSk2cDBuXX5rxGFv306mwHfBPjg5UAldw9zWGoEyvA9KpRDkeM4jfrx0rXn0GyA==} + '@inquirer/editor@4.2.9': + resolution: {integrity: sha512-8HjOppAxO7O4wV1ETUlJFg6NDjp/W2NP5FB9ZPAcinAlNT4ZIWOLe2pUVwmmPRSV0NMdI5r/+lflN55AwZOKSw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -915,8 +787,8 @@ packages: '@types/node': optional: true - '@inquirer/expand@4.0.9': - resolution: {integrity: sha512-Xxt6nhomWTAmuSX61kVgglLjMEFGa+7+F6UUtdEUeg7fg4r9vaFttUUKrtkViYYrQBA5Ia1tkOJj2koP9BuLig==} + '@inquirer/expand@4.0.11': + resolution: {integrity: sha512-OZSUW4hFMW2TYvX/Sv+NnOZgO8CHT2TU1roUCUIF2T+wfw60XFRRp9MRUPCT06cRnKL+aemt2YmTWwt7rOrNEA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -924,12 +796,12 @@ packages: '@types/node': optional: true - '@inquirer/figures@1.0.10': - resolution: {integrity: sha512-Ey6176gZmeqZuY/W/nZiUyvmb1/qInjcpiZjXWi6nON+nxJpD1bxtSoBxNliGISae32n6OwbY+TSXPZ1CfS4bw==} + '@inquirer/figures@1.0.11': + resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} engines: {node: '>=18'} - '@inquirer/input@4.1.6': - resolution: {integrity: sha512-1f5AIsZuVjPT4ecA8AwaxDFNHny/tSershP/cTvTDxLdiIGTeILNcKozB0LaYt6mojJLUbOYhpIxicaYf7UKIQ==} + '@inquirer/input@4.1.8': + resolution: {integrity: sha512-WXJI16oOZ3/LiENCAxe8joniNp8MQxF6Wi5V+EBbVA0ZIOpFcL4I9e7f7cXse0HJeIPCWO8Lcgnk98juItCi7Q==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -937,8 +809,8 @@ packages: '@types/node': optional: true - '@inquirer/number@3.0.9': - resolution: {integrity: sha512-iN2xZvH3tyIYXLXBvlVh0npk1q/aVuKXZo5hj+K3W3D4ngAEq/DkLpofRzx6oebTUhBvOgryZ+rMV0yImKnG3w==} + '@inquirer/number@3.0.11': + resolution: {integrity: sha512-pQK68CsKOgwvU2eA53AG/4npRTH2pvs/pZ2bFvzpBhrznh8Mcwt19c+nMO7LHRr3Vreu1KPhNBF3vQAKrjIulw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -946,8 +818,8 @@ packages: '@types/node': optional: true - '@inquirer/password@4.0.9': - resolution: {integrity: sha512-xBEoOw1XKb0rIN208YU7wM7oJEHhIYkfG7LpTJAEW913GZeaoQerzf5U/LSHI45EVvjAdgNXmXgH51cUXKZcJQ==} + '@inquirer/password@4.0.11': + resolution: {integrity: sha512-dH6zLdv+HEv1nBs96Case6eppkRggMe8LoOTl30+Gq5Wf27AO/vHFgStTVz4aoevLdNXqwE23++IXGw4eiOXTg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -955,8 +827,8 @@ packages: '@types/node': optional: true - '@inquirer/prompts@7.3.2': - resolution: {integrity: sha512-G1ytyOoHh5BphmEBxSwALin3n1KGNYB6yImbICcRQdzXfOGbuJ9Jske/Of5Sebk339NSGGNfUshnzK8YWkTPsQ==} + '@inquirer/prompts@7.4.0': + resolution: {integrity: sha512-EZiJidQOT4O5PYtqnu1JbF0clv36oW2CviR66c7ma4LsupmmQlUwmdReGKRp456OWPWMz3PdrPiYg3aCk3op2w==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -964,8 +836,8 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@4.0.9': - resolution: {integrity: sha512-+5t6ebehKqgoxV8fXwE49HkSF2Rc9ijNiVGEQZwvbMI61/Q5RcD+jWD6Gs1tKdz5lkI8GRBL31iO0HjGK1bv+A==} + '@inquirer/rawlist@4.0.11': + resolution: {integrity: sha512-uAYtTx0IF/PqUAvsRrF3xvnxJV516wmR6YVONOmCWJbbt87HcDHLfL9wmBQFbNJRv5kCjdYKrZcavDkH3sVJPg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -973,8 +845,8 @@ packages: '@types/node': optional: true - '@inquirer/search@3.0.9': - resolution: {integrity: sha512-DWmKztkYo9CvldGBaRMr0ETUHgR86zE6sPDVOHsqz4ISe9o1LuiWfgJk+2r75acFclA93J/lqzhT0dTjCzHuoA==} + '@inquirer/search@3.0.11': + resolution: {integrity: sha512-9CWQT0ikYcg6Ls3TOa7jljsD7PgjcsYEM0bYE+Gkz+uoW9u8eaJCRHJKkucpRE5+xKtaaDbrND+nPDoxzjYyew==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -982,8 +854,8 @@ packages: '@types/node': optional: true - '@inquirer/select@4.0.9': - resolution: {integrity: sha512-BpJyJe7Dkhv2kz7yG7bPSbJLQuu/rqyNlF1CfiiFeFwouegfH+zh13KDyt6+d9DwucKo7hqM3wKLLyJxZMO+Xg==} + '@inquirer/select@4.1.0': + resolution: {integrity: sha512-z0a2fmgTSRN+YBuiK1ROfJ2Nvrpij5lVN3gPDkQGhavdvIVGHGW29LwYZfM/j42Ai2hUghTI/uoBuTbrJk42bA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -991,8 +863,8 @@ packages: '@types/node': optional: true - '@inquirer/type@3.0.4': - resolution: {integrity: sha512-2MNFrDY8jkFYc9Il9DgLsHhMzuHnOYM1+CUYVWbzu9oT0hC7V7EcYvdCKeoll/Fcci04A+ERZ9wcc7cQ8lTkIA==} + '@inquirer/type@3.0.5': + resolution: {integrity: sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -1025,8 +897,8 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@microsoft.azure/autorest.testserver@3.3.50': - resolution: {integrity: sha512-jpJ7pzbDD0CA3/umfbMSzig2x1a8EcRd9dWYH7oFMJ0JjjueYNDLS1R3RDh1MZuys37GhddPZ4rlVgDGj7ZZsg==} + '@microsoft.azure/autorest.testserver@3.3.51': + resolution: {integrity: sha512-gHUQu95fI7mQMLa0CYT66CDX/nhJEPvznc+XyJuB8aXHvsgo9LBzqzKozk8stA6AwybikLiMb1UhCcQr8TpBGg==} engines: {node: '>=18'} hasBin: true @@ -1067,8 +939,8 @@ packages: resolution: {integrity: sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==} engines: {node: ^16.14.0 || >=18.0.0} - '@npmcli/git@6.0.1': - resolution: {integrity: sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==} + '@npmcli/git@6.0.3': + resolution: {integrity: sha512-GUYESQlxZRAdhs3UhbB6pVRNUELQOHXwK9ruDkwmCv2aZ5y0SApQzUJCg02p3A7Ue2J5hxvlk1YI53c00NmRyQ==} engines: {node: ^18.17.0 || >=20.5.0} '@npmcli/installed-package-contents@2.1.0': @@ -1133,101 +1005,101 @@ packages: resolution: {integrity: sha512-y7efHHwghQfk28G2z3tlZ67pLG0XdfYbcVG26r7YIXALRsrVQcTq4/tdenSmdOrEsNahIYA/eh8aEVROWGFUDg==} engines: {node: ^16.14.0 || >=18.0.0} - '@npmcli/run-script@9.0.2': - resolution: {integrity: sha512-cJXiUlycdizQwvqE1iaAb4VRUM3RX09/8q46zjvy+ct9GhfZRWd7jXYVc1tn/CfRlGPVkX/u4sstRlepsm7hfw==} + '@npmcli/run-script@9.1.0': + resolution: {integrity: sha512-aoNSbxtkePXUlbZB+anS1LqsJdctG5n3UVhfU47+CDdwMi6uNTBMF9gPcQRnqghQd2FGzcwwIFBruFMxjhBewg==} engines: {node: ^18.17.0 || >=20.5.0} - '@octokit/app@15.1.0': - resolution: {integrity: sha512-TkBr7QgOmE6ORxvIAhDbZsqPkF7RSqTY4pLTtUQCvr6dTXqvi2fFo46q3h1lxlk/sGMQjqyZ0kEahkD/NyzOHg==} + '@octokit/app@15.1.5': + resolution: {integrity: sha512-6cxLT9U8x7GGQ7lNWsKtFr4ccg9oLkGvowk373sX9HvX5U37kql5d55SzaQUxPE8PwgX2cqkzDm5NF5aPKevqg==} engines: {node: '>= 18'} - '@octokit/auth-app@7.1.1': - resolution: {integrity: sha512-kRAd6yelV9OgvlEJE88H0VLlQdZcag9UlLr7dV0YYP37X8PPDvhgiTy66QVhDXdyoT0AleFN2w/qXkPdrSzINg==} + '@octokit/auth-app@7.1.5': + resolution: {integrity: sha512-boklS4E6LpbA3nRx+SU2fRKRGZJdOGoSZne/i3Y0B5rfHOcGwFgcXrwDLdtbv4igfDSnAkZaoNBv1GYjPDKRNw==} engines: {node: '>= 18'} - '@octokit/auth-oauth-app@8.1.1': - resolution: {integrity: sha512-5UtmxXAvU2wfcHIPPDWzVSAWXVJzG3NWsxb7zCFplCWEmMCArSZV0UQu5jw5goLQXbFyOr5onzEH37UJB3zQQg==} + '@octokit/auth-oauth-app@8.1.3': + resolution: {integrity: sha512-4e6OjVe5rZ8yBe8w7byBjpKtSXFuro7gqeGAAZc7QYltOF8wB93rJl2FE0a4U1Mt88xxPv/mS+25/0DuLk0Ewg==} engines: {node: '>= 18'} - '@octokit/auth-oauth-device@7.1.1': - resolution: {integrity: sha512-HWl8lYueHonuyjrKKIup/1tiy0xcmQCdq5ikvMO1YwkNNkxb6DXfrPjrMYItNLyCP/o2H87WuijuE+SlBTT8eg==} + '@octokit/auth-oauth-device@7.1.3': + resolution: {integrity: sha512-BECO/N4B/Uikj0w3GCvjf/odMujtYTP3q82BJSjxC2J3rxTEiZIJ+z2xnRlDb0IE9dQSaTgRqUPVOieSbFcVzg==} engines: {node: '>= 18'} - '@octokit/auth-oauth-user@5.1.1': - resolution: {integrity: sha512-rRkMz0ErOppdvEfnemHJXgZ9vTPhBuC6yASeFaB7I2yLMd7QpjfrL1mnvRPlyKo+M6eeLxrKanXJ9Qte29SRsw==} + '@octokit/auth-oauth-user@5.1.3': + resolution: {integrity: sha512-zNPByPn9K7TC+OOHKGxU+MxrE9SZAN11UHYEFLsK2NRn3akJN2LHRl85q+Eypr3tuB2GrKx3rfj2phJdkYCvzw==} engines: {node: '>= 18'} '@octokit/auth-token@4.0.0': resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} engines: {node: '>= 18'} - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} + '@octokit/auth-token@5.1.2': + resolution: {integrity: sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==} engines: {node: '>= 18'} - '@octokit/auth-unauthenticated@6.1.0': - resolution: {integrity: sha512-zPSmfrUAcspZH/lOFQnVnvjQZsIvmfApQH6GzJrkIunDooU1Su2qt2FfMTSVPRp7WLTQyC20Kd55lF+mIYaohQ==} + '@octokit/auth-unauthenticated@6.1.2': + resolution: {integrity: sha512-07DlUGcz/AAVdzu3EYfi/dOyMSHp9YsOxPl/MPmtlVXWiD//GlV8HgZsPhud94DEyx+RfrW0wSl46Lx+AWbOlg==} engines: {node: '>= 18'} '@octokit/core@5.2.0': resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} engines: {node: '>= 18'} - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} + '@octokit/core@6.1.4': + resolution: {integrity: sha512-lAS9k7d6I0MPN+gb9bKDt7X8SdxknYqAMh44S5L+lNqIN2NuV8nvv3g8rPp7MuRxcOpxpUIATWprO0C34a8Qmg==} engines: {node: '>= 18'} - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} + '@octokit/endpoint@10.1.3': + resolution: {integrity: sha512-nBRBMpKPhQUxCsQQeW+rCJ/OPSMcj3g0nfHn01zGYZXuNDvvXudF/TYY6APj5THlurerpFN4a/dQAIAaM6BYhA==} engines: {node: '>= 18'} - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} + '@octokit/endpoint@9.0.6': + resolution: {integrity: sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==} engines: {node: '>= 18'} - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} + '@octokit/graphql@7.1.1': + resolution: {integrity: sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==} engines: {node: '>= 18'} - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} + '@octokit/graphql@8.2.1': + resolution: {integrity: sha512-n57hXtOoHrhwTWdvhVkdJHdhTv0JstjDbDRhJfwIRNfFqmSo1DaK/mD2syoNUoLCyqSjBpGAKOG0BuwF392slw==} engines: {node: '>= 18'} - '@octokit/oauth-app@7.1.3': - resolution: {integrity: sha512-EHXbOpBkSGVVGF1W+NLMmsnSsJRkcrnVmDKt0TQYRBb6xWfWzoi9sBD4DIqZ8jGhOWO/V8t4fqFyJ4vDQDn9bg==} + '@octokit/oauth-app@7.1.6': + resolution: {integrity: sha512-OMcMzY2WFARg80oJNFwWbY51TBUfLH4JGTy119cqiDawSFXSIBujxmpXiKbGWQlvfn0CxE6f7/+c6+Kr5hI2YA==} engines: {node: '>= 18'} '@octokit/oauth-authorization-url@7.1.1': resolution: {integrity: sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA==} engines: {node: '>= 18'} - '@octokit/oauth-methods@5.1.2': - resolution: {integrity: sha512-C5lglRD+sBlbrhCUTxgJAFjWgJlmTx5bQ7Ch0+2uqRjYv7Cfb5xpX4WuSC9UgQna3sqRGBL9EImX9PvTpMaQ7g==} + '@octokit/oauth-methods@5.1.4': + resolution: {integrity: sha512-Jc/ycnePClOvO1WL7tlC+TRxOFtyJBGuTDsL4dzXNiVZvzZdrPuNw7zHI3qJSUX2n6RLXE5L0SkFmYyNaVUFoQ==} engines: {node: '>= 18'} '@octokit/openapi-types@20.0.0': resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} + '@octokit/openapi-types@23.0.1': + resolution: {integrity: sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==} - '@octokit/openapi-webhooks-types@8.3.0': - resolution: {integrity: sha512-vKLsoR4xQxg4Z+6rU/F65ItTUz/EXbD+j/d4mlq2GW8TsA4Tc8Kdma2JTAAJ5hrKWUQzkR/Esn2fjsqiVRYaQg==} + '@octokit/openapi-webhooks-types@10.1.1': + resolution: {integrity: sha512-qBfqQVIDQaCFeGCofXieJDwvXcGgDn17+UwZ6WW6lfEvGYGreLFzTiaz9xjet9Us4zDf8iasoW3ixUj/R5lMhA==} - '@octokit/plugin-paginate-graphql@5.2.3': - resolution: {integrity: sha512-EzFueuXVU3VHv5FwEXbdznn9EmyF0vA5LGDX6a8fJ9YJAlDgdYHRKJMO4Ghl2PPPJBxIPMDUJMnlUHqcvP7AnQ==} + '@octokit/plugin-paginate-graphql@5.2.4': + resolution: {integrity: sha512-pLZES1jWaOynXKHOqdnwZ5ULeVR6tVVCMm+AUbp0htdcyXDU95WbkYdU4R2ej1wKj5Tu94Mee2Ne0PjPO9cCyA==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} + '@octokit/plugin-paginate-rest@11.4.3': + resolution: {integrity: sha512-tBXaAbXkqVJlRoA/zQVe9mUdb8rScmivqtpv3ovsC5xhje/a+NOCivs7eUhWBwCApJVsR4G5HMeaLbq7PxqZGA==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} + '@octokit/plugin-paginate-rest@9.2.2': + resolution: {integrity: sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '5' @@ -1244,154 +1116,154 @@ packages: peerDependencies: '@octokit/core': '5' - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} + '@octokit/plugin-rest-endpoint-methods@13.3.1': + resolution: {integrity: sha512-o8uOBdsyR+WR8MK9Cco8dCgvG13H1RlM1nWnK/W7TEACQBFux/vPREgKucxUfuDQ5yi1T3hGf4C5ZmZXAERgwQ==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-retry@7.1.2': - resolution: {integrity: sha512-XOWnPpH2kJ5VTwozsxGurw+svB2e61aWlmk5EVIYZPwFK5F9h4cyPyj9CIKRyMXMHSwpIsI3mPOdpMmrRhe7UQ==} + '@octokit/plugin-retry@7.1.4': + resolution: {integrity: sha512-7AIP4p9TttKN7ctygG4BtR7rrB0anZqoU9ThXFk8nETqIfvgPUANTSYHqWYknK7W3isw59LpZeLI8pcEwiJdRg==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' - '@octokit/plugin-throttling@9.3.1': - resolution: {integrity: sha512-Qd91H4liUBhwLB2h6jZ99bsxoQdhgPk6TdwnClPyTBSDAdviGPceViEgUwj+pcQDmB/rfAXAXK7MTochpHM3yQ==} + '@octokit/plugin-throttling@9.4.0': + resolution: {integrity: sha512-IOlXxXhZA4Z3m0EEYtrrACkuHiArHLZ3CvqWwOez/pURNqRuwfoFlTPbN5Muf28pzFuztxPyiUiNwz8KctdZaQ==} engines: {node: '>= 18'} peerDependencies: - '@octokit/core': ^6.0.0 + '@octokit/core': ^6.1.3 - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} + '@octokit/request-error@5.1.1': + resolution: {integrity: sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==} engines: {node: '>= 18'} - '@octokit/request-error@6.1.5': - resolution: {integrity: sha512-IlBTfGX8Yn/oFPMwSfvugfncK2EwRLjzbrpifNaMY8o/HTEAFqCA1FZxjD9cWvSKBHgrIhc4CSBIzMxiLsbzFQ==} + '@octokit/request-error@6.1.7': + resolution: {integrity: sha512-69NIppAwaauwZv6aOzb+VVLwt+0havz9GT5YplkeJv7fG7a40qpLt/yZKyiDxAhgz0EtgNdNcb96Z0u+Zyuy2g==} engines: {node: '>= 18'} - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} + '@octokit/request@8.4.1': + resolution: {integrity: sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==} engines: {node: '>= 18'} - '@octokit/request@9.1.3': - resolution: {integrity: sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==} + '@octokit/request@9.2.2': + resolution: {integrity: sha512-dZl0ZHx6gOQGcffgm1/Sf6JfEpmh34v3Af2Uci02vzUYz6qEN6zepoRtmybWXIGXFIK8K9ylE3b+duCWqhArtg==} engines: {node: '>= 18'} - '@octokit/rest@21.0.2': - resolution: {integrity: sha512-+CiLisCoyWmYicH25y1cDfCrv41kRSvTq6pPWtRroRJzhsCZWZyCqGyI8foJT5LmScADSwRAnr/xo+eewL04wQ==} + '@octokit/rest@21.1.1': + resolution: {integrity: sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==} engines: {node: '>= 18'} '@octokit/types@12.6.0': resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - '@octokit/types@13.5.1': - resolution: {integrity: sha512-F41lGiWBKPIWPBgjSvaDXTTQptBujnozENAK3S//nj7xsFdYdirImKlBB/hTjr+Vii68SM+8jG3UJWRa6DMuDA==} + '@octokit/types@13.8.0': + resolution: {integrity: sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==} - '@octokit/webhooks-methods@5.1.0': - resolution: {integrity: sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ==} + '@octokit/webhooks-methods@5.1.1': + resolution: {integrity: sha512-NGlEHZDseJTCj8TMMFehzwa9g7On4KJMPVHDSrHxCQumL6uSQR8wIkP/qesv52fXqV1BPf4pTxwtS31ldAt9Xg==} engines: {node: '>= 18'} - '@octokit/webhooks@13.3.0': - resolution: {integrity: sha512-TUkJLtI163Bz5+JK0O+zDkQpn4gKwN+BovclUvCj6pI/6RXrFqQvUMRS2M+Rt8Rv0qR3wjoMoOPmpJKeOh0nBg==} + '@octokit/webhooks@13.7.4': + resolution: {integrity: sha512-f386XyLTieQbgKPKS6ZMlH4dq8eLsxNddwofiKRZCq0bZ2gikoFwMD99K6l1oAwqe/KZNzrEziGicRgnzplplQ==} engines: {node: '>= 18'} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.34.4': - resolution: {integrity: sha512-gGi5adZWvjtJU7Axs//CWaQbQd/vGy8KGcnEaCWiyCqxWYDxwIlAHFuSe6Guoxtd0SRvSfVTDMPd5H+4KE2kKA==} + '@rollup/rollup-android-arm-eabi@4.35.0': + resolution: {integrity: sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.34.4': - resolution: {integrity: sha512-1aRlh1gqtF7vNPMnlf1vJKk72Yshw5zknR/ZAVh7zycRAGF2XBMVDAHmFQz/Zws5k++nux3LOq/Ejj1WrDR6xg==} + '@rollup/rollup-android-arm64@4.35.0': + resolution: {integrity: sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.34.4': - resolution: {integrity: sha512-drHl+4qhFj+PV/jrQ78p9ch6A0MfNVZScl/nBps5a7u01aGf/GuBRrHnRegA9bP222CBDfjYbFdjkIJ/FurvSQ==} + '@rollup/rollup-darwin-arm64@4.35.0': + resolution: {integrity: sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.34.4': - resolution: {integrity: sha512-hQqq/8QALU6t1+fbNmm6dwYsa0PDD4L5r3TpHx9dNl+aSEMnIksHZkSO3AVH+hBMvZhpumIGrTFj8XCOGuIXjw==} + '@rollup/rollup-darwin-x64@4.35.0': + resolution: {integrity: sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.34.4': - resolution: {integrity: sha512-/L0LixBmbefkec1JTeAQJP0ETzGjFtNml2gpQXA8rpLo7Md+iXQzo9kwEgzyat5Q+OG/C//2B9Fx52UxsOXbzw==} + '@rollup/rollup-freebsd-arm64@4.35.0': + resolution: {integrity: sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.34.4': - resolution: {integrity: sha512-6Rk3PLRK+b8L/M6m/x6Mfj60LhAUcLJ34oPaxufA+CfqkUrDoUPQYFdRrhqyOvtOKXLJZJwxlOLbQjNYQcRQfw==} + '@rollup/rollup-freebsd-x64@4.35.0': + resolution: {integrity: sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.34.4': - resolution: {integrity: sha512-kmT3x0IPRuXY/tNoABp2nDvI9EvdiS2JZsd4I9yOcLCCViKsP0gB38mVHOhluzx+SSVnM1KNn9k6osyXZhLoCA==} + '@rollup/rollup-linux-arm-gnueabihf@4.35.0': + resolution: {integrity: sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.34.4': - resolution: {integrity: sha512-3iSA9tx+4PZcJH/Wnwsvx/BY4qHpit/u2YoZoXugWVfc36/4mRkgGEoRbRV7nzNBSCOgbWMeuQ27IQWgJ7tRzw==} + '@rollup/rollup-linux-arm-musleabihf@4.35.0': + resolution: {integrity: sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.34.4': - resolution: {integrity: sha512-7CwSJW+sEhM9sESEk+pEREF2JL0BmyCro8UyTq0Kyh0nu1v0QPNY3yfLPFKChzVoUmaKj8zbdgBxUhBRR+xGxg==} + '@rollup/rollup-linux-arm64-gnu@4.35.0': + resolution: {integrity: sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.34.4': - resolution: {integrity: sha512-GZdafB41/4s12j8Ss2izofjeFXRAAM7sHCb+S4JsI9vaONX/zQ8cXd87B9MRU/igGAJkKvmFmJJBeeT9jJ5Cbw==} + '@rollup/rollup-linux-arm64-musl@4.35.0': + resolution: {integrity: sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.34.4': - resolution: {integrity: sha512-uuphLuw1X6ur11675c2twC6YxbzyLSpWggvdawTUamlsoUv81aAXRMPBC1uvQllnBGls0Qt5Siw8reSIBnbdqQ==} + '@rollup/rollup-linux-loongarch64-gnu@4.35.0': + resolution: {integrity: sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.34.4': - resolution: {integrity: sha512-KvLEw1os2gSmD6k6QPCQMm2T9P2GYvsMZMRpMz78QpSoEevHbV/KOUbI/46/JRalhtSAYZBYLAnT9YE4i/l4vg==} + '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': + resolution: {integrity: sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.34.4': - resolution: {integrity: sha512-wcpCLHGM9yv+3Dql/CI4zrY2mpQ4WFergD3c9cpRowltEh5I84pRT/EuHZsG0In4eBPPYthXnuR++HrFkeqwkA==} + '@rollup/rollup-linux-riscv64-gnu@4.35.0': + resolution: {integrity: sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.34.4': - resolution: {integrity: sha512-nLbfQp2lbJYU8obhRQusXKbuiqm4jSJteLwfjnunDT5ugBKdxqw1X9KWwk8xp1OMC6P5d0WbzxzhWoznuVK6XA==} + '@rollup/rollup-linux-s390x-gnu@4.35.0': + resolution: {integrity: sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.34.4': - resolution: {integrity: sha512-JGejzEfVzqc/XNiCKZj14eb6s5w8DdWlnQ5tWUbs99kkdvfq9btxxVX97AaxiUX7xJTKFA0LwoS0KU8C2faZRg==} + '@rollup/rollup-linux-x64-gnu@4.35.0': + resolution: {integrity: sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.34.4': - resolution: {integrity: sha512-/iFIbhzeyZZy49ozAWJ1ZR2KW6ZdYUbQXLT4O5n1cRZRoTpwExnHLjlurDXXPKEGxiAg0ujaR9JDYKljpr2fDg==} + '@rollup/rollup-linux-x64-musl@4.35.0': + resolution: {integrity: sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.34.4': - resolution: {integrity: sha512-qORc3UzoD5UUTneiP2Afg5n5Ti1GAW9Gp5vHPxzvAFFA3FBaum9WqGvYXGf+c7beFdOKNos31/41PRMUwh1tpA==} + '@rollup/rollup-win32-arm64-msvc@4.35.0': + resolution: {integrity: sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.34.4': - resolution: {integrity: sha512-5g7E2PHNK2uvoD5bASBD9aelm44nf1w4I5FEI7MPHLWcCSrR8JragXZWgKPXk5i2FU3JFfa6CGZLw2RrGBHs2Q==} + '@rollup/rollup-win32-ia32-msvc@4.35.0': + resolution: {integrity: sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.34.4': - resolution: {integrity: sha512-p0scwGkR4kZ242xLPBuhSckrJ734frz6v9xZzD+kHVYRAkSUmdSLCIJRfql6H5//aF8Q10K+i7q8DiPfZp0b7A==} + '@rollup/rollup-win32-x64-msvc@4.35.0': + resolution: {integrity: sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==} cpu: [x64] os: [win32] @@ -1414,9 +1286,9 @@ packages: resolution: {integrity: sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/protobuf-specs@0.3.2': - resolution: {integrity: sha512-c6B0ehIWxMI8wiS/bj6rHMPqeFvngFV7cDU/MY+B16P9Z3Mp9k8L93eYZ7BYzSickzuqAQqAq0V956b3Ju6mLw==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/protobuf-specs@0.3.3': + resolution: {integrity: sha512-RpacQhBlwpBWd7KEJsRKcBQalbV28fvkxwTOJIqhIuDysMMaJW47V4OqW30iJB9uRpqOSxxEAQFdr8tTattReQ==} + engines: {node: ^18.17.0 || >=20.5.0} '@sigstore/protobuf-specs@0.4.0': resolution: {integrity: sha512-o09cLSIq9EKyRXwryWDOJagkml9XgQCoCSRjHOnHLnvsivaW7Qznzz6yjfV7PHJHhIvyp8OH7OX8w0Dc5bQK7A==} @@ -1450,6 +1322,9 @@ packages: resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} engines: {node: '>=18'} + '@standard-schema/spec@1.0.0': + resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==} + '@tufjs/canonical-json@2.0.0': resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} engines: {node: ^16.14.0 || >=18.0.0} @@ -1462,8 +1337,8 @@ packages: resolution: {integrity: sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==} engines: {node: ^18.17.0 || >=20.5.0} - '@types/aws-lambda@8.10.145': - resolution: {integrity: sha512-dtByW6WiFk5W5Jfgz1VM+YPA21xMXTuSFoLYIDY0L44jDLLflVPtZkYuu3/YxpGcvjzKFBZLU+GyKjR0HOYtyw==} + '@types/aws-lambda@8.10.147': + resolution: {integrity: sha512-nD0Z9fNIZcxYX5Mai2CTmFD7wX7UldCkW2ezCF8D1T5hdiLsnTWDGRpfRYntU6VjTdLQjOvyszru7I1c1oCQew==} '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -1507,108 +1382,51 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - '@typescript-eslint/eslint-plugin@8.24.0': - resolution: {integrity: sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==} + '@typescript-eslint/eslint-plugin@8.26.1': + resolution: {integrity: sha512-2X3mwqsj9Bd3Ciz508ZUtoQQYpOhU/kWoUqIf49H8Z0+Vbh6UF/y0OEYp0Q0axOGzaBGs7QxRwq0knSQ8khQNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/eslint-plugin@8.7.0': - resolution: {integrity: sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==} + '@typescript-eslint/parser@8.26.1': + resolution: {integrity: sha512-w6HZUV4NWxqd8BdeFf81t07d7/YV9s7TCWrQQbG5uhuvGUAW+fq1usZ1Hmz9UPNLniFnD8GLSsDpjP0hm1S4lQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/parser@8.24.0': - resolution: {integrity: sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' - - '@typescript-eslint/parser@8.7.0': - resolution: {integrity: sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/scope-manager@8.24.0': - resolution: {integrity: sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==} + '@typescript-eslint/scope-manager@8.26.1': + resolution: {integrity: sha512-6EIvbE5cNER8sqBu6V7+KeMZIC1664d2Yjt+B9EWUXrsyWpxx4lEZrmvxgSKRC6gX+efDL/UY9OpPZ267io3mg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.7.0': - resolution: {integrity: sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/type-utils@8.24.0': - resolution: {integrity: sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==} + '@typescript-eslint/type-utils@8.26.1': + resolution: {integrity: sha512-Kcj/TagJLwoY/5w9JGEFV0dclQdyqw9+VMndxOJKtoFSjfZhLXhYjzsQEeyza03rwHx2vFEGvrJWJBXKleRvZg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' - - '@typescript-eslint/type-utils@8.7.0': - resolution: {integrity: sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/types@8.24.0': - resolution: {integrity: sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==} + '@typescript-eslint/types@8.26.1': + resolution: {integrity: sha512-n4THUQW27VmQMx+3P+B0Yptl7ydfceUj4ON/AQILAASwgYdZ/2dhfymRMh5egRUrvK5lSmaOm77Ry+lmXPOgBQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.7.0': - resolution: {integrity: sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.24.0': - resolution: {integrity: sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <5.8.0' - - '@typescript-eslint/typescript-estree@8.7.0': - resolution: {integrity: sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/utils@8.24.0': - resolution: {integrity: sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==} + '@typescript-eslint/typescript-estree@8.26.1': + resolution: {integrity: sha512-yUwPpUHDgdrv1QJ7YQal3cMVBGWfnuCdKbXw1yyjArax3353rEJP1ZA+4F8nOlQ3RfS2hUN/wze3nlY+ZOhvoA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/utils@8.7.0': - resolution: {integrity: sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==} + '@typescript-eslint/utils@8.26.1': + resolution: {integrity: sha512-V4Urxa/XtSUroUrnI7q6yUTD3hDtfJ2jzVfeT3VK0ciizfK2q/zGC0iDh1lFMUZR8cImRrep6/q0xd/1ZGPQpg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/visitor-keys@8.24.0': - resolution: {integrity: sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/visitor-keys@8.7.0': - resolution: {integrity: sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==} + '@typescript-eslint/visitor-keys@8.26.1': + resolution: {integrity: sha512-AjOC3zfnxd6S4Eiy3jwktJPclqhFHNyd8L6Gycf9WUPoKZpgM5PjkxY1X7uSy61xVpiJDhhk7XT2NVsN3ALTWg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typespec/compiler@0.66.0': @@ -1623,7 +1441,7 @@ packages: '@typespec/compiler': ~0.66.0 '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz': - resolution: {integrity: sha512-OhF1F7tcyBv9Q1Vqs/wPYzt9bgSrQ8nb6b9UziVf4p4qTXxPqhOT6IG14LLNTpjkWyUtFgvcNQN/m4bvtXbY+A==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz} + resolution: {integrity: sha512-jxR5ftR6qMEQdTaIAdTmPhX85XjNiqZt8l5uVxwv9UjIK2T0hzEawWeHYUYJ92fmYmtBNpIOtmbRQLMp+2vnDQ==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz} version: 0.7.1 engines: {node: '>=18.0.0'} peerDependencies: @@ -1712,11 +1530,11 @@ packages: peerDependencies: '@typespec/compiler': ~0.59.0 - '@vitest/expect@3.0.5': - resolution: {integrity: sha512-nNIOqupgZ4v5jWuQx2DSlHLEs7Q4Oh/7AYwNyE+k0UQzG7tSmjPXShUikn1mpNGzYEN2jJbTvLejwShMitovBA==} + '@vitest/expect@3.0.8': + resolution: {integrity: sha512-Xu6TTIavTvSSS6LZaA3EebWFr6tsoXPetOWNMOlc7LO88QVVBwq2oQWBoDiLCN6YTvNYsGSjqOO8CAdjom5DCQ==} - '@vitest/mocker@3.0.5': - resolution: {integrity: sha512-CLPNBFBIE7x6aEGbIjaQAX03ZZlBMaWwAjBdMkIf/cAn6xzLTiM3zYqO/WAbieEjsAZir6tO71mzeHZoodThvw==} + '@vitest/mocker@3.0.8': + resolution: {integrity: sha512-n3LjS7fcW1BCoF+zWZxG7/5XvuYH+lsFg+BDwwAz0arIwHQJFUEsKBQ0BLU49fCxuM/2HSeBPHQD8WjgrxMfow==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 || ^6.0.0 @@ -1726,20 +1544,20 @@ packages: vite: optional: true - '@vitest/pretty-format@3.0.5': - resolution: {integrity: sha512-CjUtdmpOcm4RVtB+up8r2vVDLR16Mgm/bYdkGFe3Yj/scRfCpbSi2W/BDSDcFK7ohw8UXvjMbOp9H4fByd/cOA==} + '@vitest/pretty-format@3.0.8': + resolution: {integrity: sha512-BNqwbEyitFhzYMYHUVbIvepOyeQOSFA/NeJMIP9enMntkkxLgOcgABH6fjyXG85ipTgvero6noreavGIqfJcIg==} - '@vitest/runner@3.0.5': - resolution: {integrity: sha512-BAiZFityFexZQi2yN4OX3OkJC6scwRo8EhRB0Z5HIGGgd2q+Nq29LgHU/+ovCtd0fOfXj5ZI6pwdlUmC5bpi8A==} + '@vitest/runner@3.0.8': + resolution: {integrity: sha512-c7UUw6gEcOzI8fih+uaAXS5DwjlBaCJUo7KJ4VvJcjL95+DSR1kova2hFuRt3w41KZEFcOEiq098KkyrjXeM5w==} - '@vitest/snapshot@3.0.5': - resolution: {integrity: sha512-GJPZYcd7v8QNUJ7vRvLDmRwl+a1fGg4T/54lZXe+UOGy47F9yUfE18hRCtXL5aHN/AONu29NGzIXSVFh9K0feA==} + '@vitest/snapshot@3.0.8': + resolution: {integrity: sha512-x8IlMGSEMugakInj44nUrLSILh/zy1f2/BgH0UeHpNyOocG18M9CWVIFBaXPt8TrqVZWmcPjwfG/ht5tnpba8A==} - '@vitest/spy@3.0.5': - resolution: {integrity: sha512-5fOzHj0WbUNqPK6blI/8VzZdkBlQLnT25knX0r4dbZI9qoZDf3qAdjoMmDcLG5A83W6oUUFJgUd0EYBc2P5xqg==} + '@vitest/spy@3.0.8': + resolution: {integrity: sha512-MR+PzJa+22vFKYb934CejhR4BeRpMSoxkvNoDit68GQxRLSf11aT6CTj3XaqUU9rxgWJFnqicN/wxw6yBRkI1Q==} - '@vitest/utils@3.0.5': - resolution: {integrity: sha512-N9AX0NUoUtVwKwy21JtwzaqR5L5R5A99GAbrHfCCXK1lp593i/3AZAXhSP43wRQuxYsflrdzEfXZFo1reR1Nkg==} + '@vitest/utils@3.0.8': + resolution: {integrity: sha512-nkBC3aEhfX2PdtQI/QwAWp8qZWwzASsU4Npbcd5RdMPBSSLCpkZp52P3xku3s3uA0HIEhGvEcF8rNkBsz9dQ4Q==} abbrev@2.0.0: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} @@ -1758,13 +1576,13 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.1: + resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} engines: {node: '>=0.4.0'} hasBin: true - agent-base@7.1.1: - resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} + agent-base@7.1.3: + resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} aggregate-error@3.1.0: @@ -1807,8 +1625,8 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + array-buffer-byte-length@1.0.2: + resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} array-flatten@1.1.1: @@ -1821,26 +1639,30 @@ packages: array-timsort@1.0.3: resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==} - array.prototype.findlastindex@1.2.5: - resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} + array.prototype.findlastindex@1.2.6: + resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} engines: {node: '>= 0.4'} - array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + array.prototype.flat@1.3.3: + resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==} engines: {node: '>= 0.4'} - array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} + array.prototype.flatmap@1.3.3: + resolution: {integrity: sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==} engines: {node: '>= 0.4'} - arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + async-function@1.0.0: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} @@ -1856,8 +1678,8 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - axios@1.7.9: - resolution: {integrity: sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==} + axios@1.8.3: + resolution: {integrity: sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==} balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1893,8 +1715,8 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.24.0: - resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} + browserslist@4.24.4: + resolution: {integrity: sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -1938,19 +1760,27 @@ packages: resolution: {integrity: sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==} engines: {node: ^18.17.0 || >=20.5.0} - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001663: - resolution: {integrity: sha512-o9C3X27GLKbLeTYZ6HBOLU1tsAcBZsLis28wrVzddShCS16RujjHp9GDHKZqrB3meE0YjhawvMFsGb/igqiPzA==} + caniuse-lite@1.0.30001705: + resolution: {integrity: sha512-S0uyMMiYvA7CxNgomYBwwwPUnWzFD83f3B1ce5jHUfHTH//QL6hHsreI8RVC5606R4ssqravelYO5TU6t8sEyg==} - chai@5.1.2: - resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} + chai@5.2.0: + resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} engines: {node: '>=12'} chalk-template@1.1.0: @@ -1965,6 +1795,10 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + chalk@5.4.1: + resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} @@ -1983,8 +1817,8 @@ packages: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} + ci-info@4.2.0: + resolution: {integrity: sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==} engines: {node: '>=8'} clean-regexp@1.0.0: @@ -1999,9 +1833,9 @@ packages: resolution: {integrity: sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==} engines: {node: '>=8'} - cli-cursor@4.0.0: - resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} @@ -2052,8 +1886,8 @@ packages: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} - commander@12.1.0: - resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} engines: {node: '>=18'} comment-json@4.2.5: @@ -2092,16 +1926,12 @@ packages: cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} - cookie@0.6.0: - resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} - engines: {node: '>= 0.6'} - cookie@0.7.1: resolution: {integrity: sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==} engines: {node: '>= 0.6'} - core-js-compat@3.38.1: - resolution: {integrity: sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==} + core-js-compat@3.41.0: + resolution: {integrity: sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A==} core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -2124,8 +1954,8 @@ packages: engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} hasBin: true - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} crypto-random-string@4.0.0: @@ -2176,16 +2006,16 @@ packages: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} - data-view-buffer@1.0.1: - resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + data-view-buffer@1.0.2: + resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} engines: {node: '>= 0.4'} - data-view-byte-length@1.0.1: - resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + data-view-byte-length@1.0.2: + resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} engines: {node: '>= 0.4'} - data-view-byte-offset@1.0.0: - resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} engines: {node: '>= 0.4'} debug@2.6.9: @@ -2204,15 +2034,6 @@ packages: supports-color: optional: true - debug@4.3.7: - resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.4.0: resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} engines: {node: '>=6.0'} @@ -2268,6 +2089,10 @@ packages: resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} engines: {node: '>=10'} + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -2277,11 +2102,11 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - effect@3.6.5: - resolution: {integrity: sha512-NhopZTAKljaAlR0CEroOAJJngdqg7bzlnWcDrCwh4d2WNVohVbBtUS4SGqLt8tUy7IFsTWATYiUtmhDG+YELjA==} + effect@3.13.11: + resolution: {integrity: sha512-SOUwX2E1ciNDPZDbSfx+YszGfIIg90sluKyx0BB6VwLIt8+NOA6tEAR3N2XI9MEOWfO/EpWzbARLnXI2hXcvaQ==} - electron-to-chromium@1.5.28: - resolution: {integrity: sha512-VufdJl+rzaKZoYVUijN13QcXVF5dWPZANeFTLNy+OSpHdDL5ynXTF35+60RSBbaQYB1ae723lQXHCrf4pyLsMw==} + electron-to-chromium@1.5.119: + resolution: {integrity: sha512-Ku4NMzUjz3e3Vweh7PhApPrZSS4fyiCIbcIrG9eKrriYVLmbMepETR/v6SU7xPm98QTqMSYiCwfO89QNjXLkbQ==} emoji-regex@10.4.0: resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} @@ -2323,12 +2148,12 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es-abstract@1.23.3: - resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + es-abstract@1.23.9: + resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} engines: {node: '>= 0.4'} - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} es-errors@1.3.0: @@ -2341,28 +2166,24 @@ packages: es-module-lexer@1.6.0: resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} - es-set-tostringtag@2.0.3: - resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} - es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - - es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + es-shim-unscopables@1.1.0: + resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==} engines: {node: '>= 0.4'} - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} - hasBin: true + es-to-primitive@1.3.0: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + engines: {node: '>= 0.4'} - esbuild@0.23.1: - resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + esbuild@0.25.1: + resolution: {integrity: sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==} engines: {node: '>=18'} hasBin: true @@ -2384,8 +2205,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-module-utils@2.11.1: - resolution: {integrity: sha512-EwcbfLOhwVMAfatfqLecR2yv3dE5+kQ8kx+Rrt0DvDXEVwW86KQ/xbMDQhtp5l42VXukD5SOF8mQQHbaNtO0CQ==} + eslint-module-utils@2.12.0: + resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -2405,12 +2226,12 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-import@2.30.0: - resolution: {integrity: sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==} + eslint-plugin-import@2.31.0: + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 peerDependenciesMeta: '@typescript-eslint/parser': optional: true @@ -2421,24 +2242,20 @@ packages: peerDependencies: eslint: '>=8.56.0' - eslint-scope@8.0.2: - resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} + eslint-scope@8.3.0: + resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.0.0: - resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint-visitor-keys@4.2.0: resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.11.1: - resolution: {integrity: sha512-MobhYKIoAO1s1e4VUrgx1l1Sk2JBR/Gqjjgw8+mfgoLE2xwsHur4gdfTxyTgShrhvdVFTaJSgMiQBl1jv/AWxg==} + eslint@9.22.0: + resolution: {integrity: sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -2447,8 +2264,8 @@ packages: jiti: optional: true - espree@10.1.0: - resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -2483,12 +2300,12 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - expect-type@1.1.0: - resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} + expect-type@1.2.0: + resolution: {integrity: sha512-80F22aiJ3GLyVnS/B3HzgR6RelZVumzj9jkL0Rhz4h0xYbNW9PjlQz5h3J/SShErbXBc295vseR4/MIbVmUbeA==} engines: {node: '>=12.0.0'} - exponential-backoff@3.1.1: - resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + exponential-backoff@3.1.2: + resolution: {integrity: sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==} express-promise-router@4.1.1: resolution: {integrity: sha512-Lkvcy/ZGrBhzkl3y7uYBHLMtLI4D6XQ2kiFg9dq7fbktBch5gjqJ0+KovX0cvCAvTJw92raWunRLM/OM+5l4fA==} @@ -2500,10 +2317,6 @@ packages: '@types/express': optional: true - express@4.21.0: - resolution: {integrity: sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==} - engines: {node: '>= 0.10.0'} - express@4.21.2: resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==} engines: {node: '>= 0.10.0'} @@ -2512,10 +2325,13 @@ packages: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} engines: {node: '>=4'} - fast-check@3.21.0: - resolution: {integrity: sha512-QpmbiqRFRZ+SIlBJh6xi5d/PgXciUc/xWKc4Vi2RWEHHIRx6oM3f0fWNna++zP9VB5HUBTObUK9gTKQP3vVcrQ==} + fast-check@3.23.2: + resolution: {integrity: sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==} engines: {node: '>=8.0.0'} + fast-content-type-parse@2.0.1: + resolution: {integrity: sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -2526,8 +2342,8 @@ packages: resolution: {integrity: sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==} engines: {node: '>=6.0.0'} - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} fast-json-stable-stringify@2.1.0: @@ -2536,15 +2352,15 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-uri@3.0.1: - resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + fast-uri@3.0.6: + resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} - fast-xml-parser@4.5.0: - resolution: {integrity: sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==} + fast-xml-parser@5.0.9: + resolution: {integrity: sha512-2mBwCiuW3ycKQQ6SOesSB8WeF+fIGb6I/GG5vU5/XEptwFFhp9PE8b9O7fbs2dpq9fXn4ULR3UsfydNUCntf5A==} hasBin: true - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} fecha@4.2.3: resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} @@ -2589,8 +2405,8 @@ packages: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flatted@3.3.3: + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} fn.name@1.1.0: resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} @@ -2604,15 +2420,16 @@ packages: debug: optional: true - for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} - foreground-child@3.3.0: - resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.1: - resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} + form-data@4.0.2: + resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} engines: {node: '>= 6'} formdata-polyfill@4.0.10: @@ -2650,8 +2467,8 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + function.prototype.name@1.1.8: + resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} engines: {node: '>= 0.4'} functions-have-names@1.2.3: @@ -2665,24 +2482,28 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} engines: {node: '>=18'} - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} get-stdin@9.0.0: resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} engines: {node: '>=12'} - get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - get-tsconfig@4.8.1: - resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + get-tsconfig@4.10.0: + resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} @@ -2696,8 +2517,8 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true - glob@11.0.0: - resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + glob@11.0.1: + resolution: {integrity: sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==} engines: {node: 20 || >=22} hasBin: true @@ -2718,8 +2539,8 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@15.9.0: - resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} + globals@15.15.0: + resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} globalthis@1.0.4: @@ -2730,8 +2551,13 @@ packages: resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} engines: {node: '>=18'} - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + globby@14.1.0: + resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} + engines: {node: '>=18'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -2739,8 +2565,9 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + has-bigints@1.1.0: + resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} + engines: {node: '>= 0.4'} has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} @@ -2753,12 +2580,12 @@ packages: has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} engines: {node: '>= 0.4'} - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} has-tostringtag@1.0.2: @@ -2794,8 +2621,8 @@ packages: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} - https-proxy-agent@7.0.5: - resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} iconv-lite@0.4.24: @@ -2818,8 +2645,12 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + ignore@7.0.3: + resolution: {integrity: sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==} + engines: {node: '>= 4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} import-meta-resolve@3.1.1: @@ -2852,8 +2683,8 @@ packages: resolution: {integrity: sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==} engines: {node: ^18.17.0 || >=20.5.0} - internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} ip-address@9.0.5: @@ -2864,12 +2695,12 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} - is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + is-arguments@1.2.0: + resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} engines: {node: '>= 0.4'} - is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} is-arrayish@0.2.1: @@ -2878,11 +2709,16 @@ packages: is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} - is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + is-async-function@2.1.1: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} + engines: {node: '>= 0.4'} + + is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} - is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + is-boolean-object@1.2.2: + resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} engines: {node: '>= 0.4'} is-builtin-module@3.2.1: @@ -2893,16 +2729,16 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.15.1: - resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} - is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} - is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} is-docker@2.2.1: @@ -2914,10 +2750,18 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-function@1.1.0: + resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + engines: {node: '>= 0.4'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2933,12 +2777,8 @@ packages: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} - is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - - is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + is-number-object@1.1.1: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} engines: {node: '>= 0.4'} is-number@7.0.0: @@ -2949,39 +2789,35 @@ packages: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} - is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} is-set@2.0.3: resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} engines: {node: '>= 0.4'} - is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} engines: {node: '>= 0.4'} is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + is-string@1.1.1: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} engines: {node: '>= 0.4'} - is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} engines: {node: '>= 0.4'} - is-typed-array@1.1.13: - resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} engines: {node: '>= 0.4'} is-typedarray@1.0.0: @@ -2999,11 +2835,12 @@ packages: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} - is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + is-weakref@1.1.1: + resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} + engines: {node: '>= 0.4'} - is-weakset@2.0.3: - resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} + is-weakset@2.0.4: + resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} engines: {node: '>= 0.4'} is-wsl@2.2.0: @@ -3038,14 +2875,14 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - jackspeak@4.0.1: - resolution: {integrity: sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==} - engines: {node: 20 || >=22} - jackspeak@4.0.2: resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} engines: {node: 20 || >=22} + jackspeak@4.1.0: + resolution: {integrity: sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==} + engines: {node: 20 || >=22} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3060,8 +2897,8 @@ packages: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} hasBin: true @@ -3187,10 +3024,6 @@ packages: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} - logform@2.6.1: - resolution: {integrity: sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==} - engines: {node: '>= 12.0.0'} - logform@2.7.0: resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} engines: {node: '>= 12.0.0'} @@ -3201,8 +3034,8 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.0.1: - resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + lru-cache@11.0.2: + resolution: {integrity: sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==} engines: {node: 20 || >=22} magic-string@0.30.17: @@ -3225,6 +3058,10 @@ packages: engines: {node: '>= 18'} hasBin: true + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} @@ -3260,9 +3097,9 @@ packages: engines: {node: '>=4'} hasBin: true - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -3294,8 +3131,8 @@ packages: resolution: {integrity: sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - minipass-fetch@4.0.0: - resolution: {integrity: sha512-2v6aXUXwLP1Epd/gc32HAMIWoczx+fZwEPRHm/VwtrJzRGwR1qGZXEYV3Zp8ZjjbwaZhMrM6uHV4KVkk+XCc2w==} + minipass-fetch@4.0.1: + resolution: {integrity: sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==} engines: {node: ^18.17.0 || >=20.5.0} minipass-flush@1.0.5: @@ -3366,8 +3203,8 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} - nanoid@3.3.8: - resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} + nanoid@3.3.10: + resolution: {integrity: sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -3378,6 +3215,10 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} + negotiator@0.6.4: + resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==} + engines: {node: '>= 0.6'} + negotiator@1.0.0: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} @@ -3399,8 +3240,8 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-gyp@10.2.0: - resolution: {integrity: sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==} + node-gyp@10.3.1: + resolution: {integrity: sha512-Pp3nFHBThHzVtNY7U6JfPjvT/DTE8+o/4xKsLQtBoU+j2HLsGlhcfzflAoUreaJbNmYnX+LlLi0qjV8kpyO6xQ==} engines: {node: ^16.14.0 || >=18.0.0} hasBin: true @@ -3409,8 +3250,8 @@ packages: engines: {node: ^18.17.0 || >=20.5.0} hasBin: true - node-releases@2.0.18: - resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} nopt@7.2.1: resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==} @@ -3489,8 +3330,8 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - object-inspect@1.13.2: - resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} engines: {node: '>= 0.4'} object-is@1.1.6: @@ -3501,8 +3342,8 @@ packages: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} - object.assign@4.1.5: - resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} engines: {node: '>= 0.4'} object.fromentries@2.0.8: @@ -3513,12 +3354,12 @@ packages: resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} engines: {node: '>= 0.4'} - object.values@1.2.0: - resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} + object.values@1.2.1: + resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} - octokit@4.0.2: - resolution: {integrity: sha512-wbqF4uc1YbcldtiBFfkSnquHtECEIpYD78YUXI6ri1Im5OO2NLo6ZVpRdbJpdnpZ05zMrVPssNiEo6JQtea+Qg==} + octokit@4.1.2: + resolution: {integrity: sha512-0kcTxJOK3yQrJsRb8wKa28hlTze4QOz4sLuUnfXXnhboDhFKgv8LxS86tFwbsafDW9JZ08ByuVAE8kQbYJIZkA==} engines: {node: '>= 18'} on-finished@2.3.0: @@ -3539,9 +3380,9 @@ packages: one-time@1.0.0: resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==} - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} @@ -3551,14 +3392,18 @@ packages: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - ora@8.0.1: - resolution: {integrity: sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==} + ora@8.2.0: + resolution: {integrity: sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==} engines: {node: '>=18'} os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + own-keys@1.0.1: + resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} + engines: {node: '>= 0.4'} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -3595,8 +3440,8 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - package-json-from-dist@1.0.0: - resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} pacote@18.0.6: resolution: {integrity: sha512-+eK3G27SMwsB8kLIuj4h1FUhHtwiEUo21Tw8wNjmvdlpOEr613edv+8FUsTj/4F/VN5ywGE19X18N7CC2EJk6A==} @@ -3660,9 +3505,6 @@ packages: resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} engines: {node: 20 || >=22} - path-to-regexp@0.1.10: - resolution: {integrity: sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==} - path-to-regexp@0.1.12: resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} @@ -3674,6 +3516,10 @@ packages: resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} engines: {node: '>=12'} + path-type@6.0.0: + resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==} + engines: {node: '>=18'} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -3681,9 +3527,6 @@ packages: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} - picocolors@1.1.0: - resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -3695,16 +3538,16 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - possible-typed-array-names@1.0.0: - resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} postcss-selector-parser@6.1.2: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} - postcss@8.5.1: - resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} + postcss@8.5.3: + resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -3818,12 +3661,16 @@ packages: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} + reflect.getprototypeof@1.0.10: + resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} + engines: {node: '>= 0.4'} + regexp-tree@0.1.27: resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} hasBin: true - regexp.prototype.flags@1.5.2: - resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + regexp.prototype.flags@1.5.4: + resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} regjsparser@0.10.0: @@ -3853,20 +3700,21 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} hasBin: true - restore-cursor@4.0.0: - resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} rimraf@3.0.2: @@ -3883,16 +3731,16 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.34.4: - resolution: {integrity: sha512-spF66xoyD7rz3o08sHP7wogp1gZ6itSq22SGa/IZTcUDXDlOyrShwMwkVSB+BUxFRZZCUYqdb3KWDEOMVQZxuw==} + rollup@4.35.0: + resolution: {integrity: sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} safe-buffer@5.1.2: @@ -3901,8 +3749,12 @@ packages: safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + safe-push-apply@1.0.0: + resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} + engines: {node: '>= 0.4'} + + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} safe-stable-stringify@2.5.0: @@ -3928,6 +3780,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.7.1: + resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} + engines: {node: '>=10'} + hasBin: true + send@0.19.0: resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} engines: {node: '>= 0.8.0'} @@ -3944,6 +3801,10 @@ packages: resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} engines: {node: '>= 0.4'} + set-proto@1.0.0: + resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} + engines: {node: '>= 0.4'} + setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -3955,8 +3816,20 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} engines: {node: '>= 0.4'} siginfo@2.0.0: @@ -3991,12 +3864,12 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - socks-proxy-agent@8.0.4: - resolution: {integrity: sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==} + socks-proxy-agent@8.0.5: + resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} engines: {node: '>= 14'} - socks@2.8.3: - resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} + socks@2.8.4: + resolution: {integrity: sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} source-map-js@1.2.1: @@ -4019,8 +3892,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.20: - resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} + spdx-license-ids@3.0.21: + resolution: {integrity: sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==} sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} @@ -4043,18 +3916,15 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} - std-env@3.7.0: - resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} - - std-env@3.8.0: - resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} + std-env@3.8.1: + resolution: {integrity: sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==} stdin-discarder@0.2.2: resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} engines: {node: '>=18'} - stop-iteration-iterator@1.0.0: - resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} stoppable@1.1.0: @@ -4080,12 +3950,13 @@ packages: string.prototype.repeat@0.2.0: resolution: {integrity: sha512-1BH+X+1hSthZFW+X+JaUkjkkUPwIlLEMJBLANN3hOob3RhEk5snLWNECDnYbgn/m5c5JV7Ersu1Yubaf+05cIA==} - string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} - string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + string.prototype.trimend@1.0.9: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} string.prototype.trimstart@1.0.8: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} @@ -4121,8 +3992,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strnum@1.0.5: - resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + strnum@2.0.5: + resolution: {integrity: sha512-YAT3K/sgpCUxhxNMrrdhtod3jckkpYwH6JAuwmUdXZsmzH1wUyzTMrrK2wYCEEqlKwrWDd35NeuUkbBy/1iK+Q==} supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} @@ -4132,8 +4003,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - syncpack@13.0.0: - resolution: {integrity: sha512-0PIoEWMP2+YkllkcZXw8N9d2sFqpmr8ULBdvms3gc1vG5tnccEMqc6flxHYnF/N+NTTcUnf0J+4xAD5hwH6XGQ==} + syncpack@13.0.3: + resolution: {integrity: sha512-ZKrdDVmOUBWeaTVaxRnfwtqBJ5rMzMo7Lfdp04wtORwHEcvrq6M+NzCwS4PPIhTucD005wD8wumy90Ucz3lwXg==} engines: {node: '>=18.18.0'} hasBin: true @@ -4158,9 +4029,6 @@ packages: text-hex@1.0.0: resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - tightrope@0.2.0: resolution: {integrity: sha512-Kw36UHxJEELq2VUqdaSGR2/8cAsPgMtvX8uGVU6Jk26O66PhXec0A5ZnRYs47btbtwPDpXXF66+Fo3vimCM9aQ==} engines: {node: '>=16'} @@ -4191,6 +4059,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toad-cache@3.7.0: + resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} + engines: {node: '>=12'} + toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -4206,12 +4078,6 @@ packages: resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} engines: {node: '>= 14.0.0'} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - ts-api-utils@2.0.1: resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==} engines: {node: '>=18.12'} @@ -4224,11 +4090,11 @@ packages: tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tsx@4.19.2: - resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} + tsx@4.19.3: + resolution: {integrity: sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==} engines: {node: '>=18.0.0'} hasBin: true @@ -4268,20 +4134,20 @@ packages: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} - typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} - typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} engines: {node: '>= 0.4'} - typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + typed-array-byte-offset@1.0.4: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} engines: {node: '>= 0.4'} - typed-array-length@1.0.6: - resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + typed-array-length@1.0.7: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} typedarray-to-buffer@3.1.5: @@ -4290,29 +4156,20 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript-eslint@8.24.0: - resolution: {integrity: sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==} + typescript-eslint@8.26.1: + resolution: {integrity: sha512-t/oIs9mYyrwZGRpDv3g+3K6nZ5uhKEMt2oNmAPwaY4/ye0+EH4nXIPYNtkYFS6QHm+1DFg34DbglYBz5P9Xysg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' - - typescript-eslint@8.7.0: - resolution: {integrity: sha512-nEHbEYJyHwsuf7c3V3RS7Saq+1+la3i0ieR3qP0yjqWSzVmh8Drp47uOl9LjbPANac4S7EFSqvcYIKXUUwIfIQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.9.0' typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true @@ -4321,8 +4178,9 @@ packages: engines: {node: '>=14.17'} hasBin: true - unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + unbox-primitive@1.1.0: + resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} + engines: {node: '>= 0.4'} underscore@1.13.7: resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==} @@ -4333,14 +4191,18 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} - undici@5.28.4: - resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} + undici@5.28.5: + resolution: {integrity: sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==} engines: {node: '>=14.0'} unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} + unicorn-magic@0.3.0: + resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} + engines: {node: '>=18'} + unique-filename@3.0.0: resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -4378,8 +4240,8 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -4417,27 +4279,32 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - vite-node@3.0.5: - resolution: {integrity: sha512-02JEJl7SbtwSDJdYS537nU6l+ktdvcREfLksk/NDAqtdKWGqHl+joXzEubHROmS3E6pip+Xgu2tFezMu75jH7A==} + vite-node@3.0.8: + resolution: {integrity: sha512-6PhR4H9VGlcwXZ+KWCdMqbtG649xCPZqfI9j2PsK1FcXgEzro5bGHcVKFCTqPLaNKZES8Evqv4LwvZARsq5qlg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@5.4.14: - resolution: {integrity: sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==} - engines: {node: ^18.0.0 || >=20.0.0} + vite@6.2.2: + resolution: {integrity: sha512-yW7PeMM+LkDzc7CgJuRLMW2Jz0FxMOsVJ8Lv3gpgW9WLcb9cTW+121UEr1hvmfR7w3SegR5ItvYyzVz1vxNJgQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' less: '*' lightningcss: ^1.21.0 sass: '*' sass-embedded: '*' stylus: '*' sugarss: '*' - terser: ^5.4.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: '@types/node': optional: true + jiti: + optional: true less: optional: true lightningcss: @@ -4452,17 +4319,21 @@ packages: optional: true terser: optional: true + tsx: + optional: true + yaml: + optional: true - vitest@3.0.5: - resolution: {integrity: sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q==} + vitest@3.0.8: + resolution: {integrity: sha512-dfqAsNqRGUc8hB9OVR2P0w8PZPEckti2+5rdZip0WIz9WW0MnImJ8XiR61QhqLa92EQzKP2uPkzenKOAHyEIbA==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.0.5 - '@vitest/ui': 3.0.5 + '@vitest/browser': 3.0.8 + '@vitest/ui': 3.0.8 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -4498,8 +4369,8 @@ packages: resolution: {integrity: sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==} hasBin: true - vscode-uri@3.0.8: - resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} + vscode-uri@3.1.0: + resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} walk-up-path@3.0.1: resolution: {integrity: sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==} @@ -4514,15 +4385,20 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + which-boxed-primitive@1.1.1: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + + which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} which-collection@1.0.2: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} engines: {node: '>= 0.4'} - which-typed-array@1.1.15: - resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} engines: {node: '>= 0.4'} which@2.0.2: @@ -4545,18 +4421,10 @@ packages: engines: {node: '>=8'} hasBin: true - winston-transport@4.7.1: - resolution: {integrity: sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==} - engines: {node: '>= 12.0.0'} - winston-transport@4.9.0: resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} engines: {node: '>= 12.0.0'} - winston@3.14.2: - resolution: {integrity: sha512-CO8cdpBB2yqzEf8v895L+GNKYJiEq8eKlHU38af3snQBQ+sdAIUepjMSguOIJC7ICbzm0ZI+Af2If4vIJrtmOg==} - engines: {node: '>= 12.0.0'} - winston@3.17.0: resolution: {integrity: sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==} engines: {node: '>= 12.0.0'} @@ -4587,8 +4455,8 @@ packages: resolution: {integrity: sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==} engines: {node: ^18.17.0 || >=20.5.0} - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + ws@8.18.1: + resolution: {integrity: sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -4626,11 +4494,6 @@ packages: resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} engines: {node: '>=18'} - yaml@2.5.1: - resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} - engines: {node: '>= 14'} - hasBin: true - yaml@2.7.0: resolution: {integrity: sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==} engines: {node: '>= 14'} @@ -4648,16 +4511,16 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.1.1: - resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} + yocto-queue@1.2.0: + resolution: {integrity: sha512-KHBC7z61OJeaMGnF3wqNZj+GGNXOyypZviiKpQeiHirG5Ib1ImwcLBH70rbMSkKfSmUNBsdf2PwaEJtKvgmkNw==} engines: {node: '>=12.20'} yoctocolors-cjs@2.1.2: resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} engines: {node: '>=18'} - zod@3.23.8: - resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zod@3.24.2: + resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==} snapshots: @@ -4665,19 +4528,39 @@ snapshots: dependencies: '@actions/http-client': 2.2.3 '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) + '@octokit/plugin-paginate-rest': 9.2.2(@octokit/core@5.2.0) '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) '@actions/http-client@2.2.3': dependencies: tunnel: 0.0.6 - undici: 5.28.4 + undici: 5.28.5 + + '@autorest/python@file:packages/autorest.python(rf26q5ggt4rglvdg4e5l33mtfi)': + dependencies: + '@autorest/system-requirements': 1.0.2 + '@typespec/http-client-python': file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi) + fs-extra: 11.2.0 + tsx: 4.19.3 + transitivePeerDependencies: + - '@azure-tools/typespec-autorest' + - '@azure-tools/typespec-azure-core' + - '@azure-tools/typespec-azure-resource-manager' + - '@azure-tools/typespec-azure-rulesets' + - '@azure-tools/typespec-client-generator-core' + - '@typespec/compiler' + - '@typespec/http' + - '@typespec/openapi' + - '@typespec/rest' + - '@typespec/versioning' + - bufferutil + - utf-8-validate '@autorest/system-requirements@1.0.2': dependencies: '@azure/logger': 1.1.4 command-exists: 1.2.9 - semver: 7.6.3 + semver: 7.7.1 '@azure-tools/azure-http-specs@0.1.0-alpha.7(vv5y5mczssczr6kdmnzvay4nom)': dependencies: @@ -4693,7 +4576,6 @@ snapshots: - '@types/express' - '@types/node' - '@typespec/streams' - - bluebird - debug - supports-color @@ -4801,37 +4683,31 @@ snapshots: '@azure/abort-controller@2.1.2': dependencies: - tslib: 2.7.0 - - '@azure/core-auth@1.8.0': - dependencies: - '@azure/abort-controller': 2.1.2 - '@azure/core-util': 1.11.0 - tslib: 2.7.0 + tslib: 2.8.1 '@azure/core-auth@1.9.0': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-util': 1.11.0 - tslib: 2.7.0 + tslib: 2.8.1 - '@azure/core-client@1.9.2': + '@azure/core-client@1.9.3': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-auth': 1.9.0 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 + '@azure/core-rest-pipeline': 1.19.1 + '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - supports-color - '@azure/core-http-compat@2.1.2': + '@azure/core-http-compat@2.2.0': dependencies: '@azure/abort-controller': 2.1.2 - '@azure/core-client': 1.9.2 - '@azure/core-rest-pipeline': 1.17.0 + '@azure/core-client': 1.9.3 + '@azure/core-rest-pipeline': 1.19.1 transitivePeerDependencies: - supports-color @@ -4840,74 +4716,69 @@ snapshots: '@azure/abort-controller': 2.1.2 '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 - tslib: 2.7.0 + tslib: 2.8.1 '@azure/core-paging@1.6.2': dependencies: - tslib: 2.7.0 + tslib: 2.8.1 - '@azure/core-rest-pipeline@1.17.0': + '@azure/core-rest-pipeline@1.19.1': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-auth': 1.9.0 - '@azure/core-tracing': 1.1.2 + '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.5 - tslib: 2.7.0 + https-proxy-agent: 7.0.6 + tslib: 2.8.1 transitivePeerDependencies: - supports-color - '@azure/core-tracing@1.1.2': - dependencies: - tslib: 2.7.0 - - '@azure/core-util@1.10.0': + '@azure/core-tracing@1.2.0': dependencies: - '@azure/abort-controller': 2.1.2 - tslib: 2.7.0 + tslib: 2.8.1 '@azure/core-util@1.11.0': dependencies: '@azure/abort-controller': 2.1.2 - tslib: 2.7.0 + tslib: 2.8.1 - '@azure/core-xml@1.4.3': + '@azure/core-xml@1.4.5': dependencies: - fast-xml-parser: 4.5.0 - tslib: 2.7.0 + fast-xml-parser: 5.0.9 + tslib: 2.8.1 '@azure/identity@4.6.0': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-auth': 1.9.0 - '@azure/core-client': 1.9.2 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 + '@azure/core-client': 1.9.3 + '@azure/core-rest-pipeline': 1.19.1 + '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 - '@azure/msal-browser': 4.2.1 + '@azure/msal-browser': 4.7.0 '@azure/msal-node': 2.16.2 events: 3.3.0 jws: 4.0.0 open: 8.4.2 stoppable: 1.1.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - supports-color '@azure/logger@1.1.4': dependencies: - tslib: 2.7.0 + tslib: 2.8.1 - '@azure/msal-browser@4.2.1': + '@azure/msal-browser@4.7.0': dependencies: - '@azure/msal-common': 15.1.1 + '@azure/msal-common': 15.2.1 '@azure/msal-common@14.16.0': {} - '@azure/msal-common@15.1.1': {} + '@azure/msal-common@15.2.1': {} '@azure/msal-node@2.16.2': dependencies: @@ -4915,39 +4786,21 @@ snapshots: jsonwebtoken: 9.0.2 uuid: 8.3.2 - '@azure/storage-blob@12.25.0': - dependencies: - '@azure/abort-controller': 2.1.2 - '@azure/core-auth': 1.8.0 - '@azure/core-client': 1.9.2 - '@azure/core-http-compat': 2.1.2 - '@azure/core-lro': 2.7.2 - '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 - '@azure/core-util': 1.10.0 - '@azure/core-xml': 1.4.3 - '@azure/logger': 1.1.4 - events: 3.3.0 - tslib: 2.7.0 - transitivePeerDependencies: - - supports-color - '@azure/storage-blob@12.26.0': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-auth': 1.9.0 - '@azure/core-client': 1.9.2 - '@azure/core-http-compat': 2.1.2 + '@azure/core-client': 1.9.3 + '@azure/core-http-compat': 2.2.0 '@azure/core-lro': 2.7.2 '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 + '@azure/core-rest-pipeline': 1.19.1 + '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 - '@azure/core-xml': 1.4.3 + '@azure/core-xml': 1.4.5 '@azure/logger': 1.1.4 events: 3.3.0 - tslib: 2.7.0 + tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -4957,63 +4810,59 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/helper-validator-identifier@7.24.7': {} - '@babel/helper-validator-identifier@7.25.9': {} '@bcoe/v8-coverage@1.0.2': {} '@chronus/chronus@0.12.1': dependencies: - cross-spawn: 7.0.3 - globby: 14.0.2 + cross-spawn: 7.0.6 + globby: 14.1.0 is-unicode-supported: 2.1.0 micromatch: 4.0.8 pacote: 18.0.6 - picocolors: 1.1.0 + picocolors: 1.1.1 pluralize: 8.0.0 prompts: 2.4.2 - semver: 7.6.3 + semver: 7.7.1 source-map-support: 0.5.21 - std-env: 3.7.0 - yaml: 2.5.1 + std-env: 3.8.1 + yaml: 2.7.0 yargs: 17.7.2 - zod: 3.23.8 + zod: 3.24.2 transitivePeerDependencies: - bluebird - supports-color - '@chronus/chronus@0.13.0': + '@chronus/chronus@0.17.0': dependencies: - cross-spawn: 7.0.3 - globby: 14.0.2 + cross-spawn: 7.0.6 + globby: 14.1.0 is-unicode-supported: 2.1.0 micromatch: 4.0.8 - pacote: 18.0.6 + pacote: 20.0.0 picocolors: 1.1.1 pluralize: 8.0.0 prompts: 2.4.2 - semver: 7.6.3 + semver: 7.7.1 source-map-support: 0.5.21 - std-env: 3.8.0 + std-env: 3.8.1 yaml: 2.7.0 yargs: 17.7.2 - zod: 3.23.8 + zod: 3.24.2 transitivePeerDependencies: - - bluebird - supports-color - '@chronus/github@0.4.4': + '@chronus/github@0.4.9': dependencies: - '@chronus/chronus': 0.13.0 - '@octokit/graphql': 8.1.1 - '@octokit/rest': 21.0.2 - cross-spawn: 7.0.3 - octokit: 4.0.2 - picocolors: 1.1.0 + '@chronus/chronus': 0.17.0 + '@octokit/graphql': 8.2.1 + '@octokit/rest': 21.1.1 + cross-spawn: 7.0.6 + octokit: 4.1.2 + picocolors: 1.1.1 yargs: 17.7.2 transitivePeerDependencies: - - bluebird - supports-color '@colors/colors@1.6.0': {} @@ -5023,7 +4872,7 @@ snapshots: '@cspell/dict-ada': 4.1.0 '@cspell/dict-aws': 4.0.9 '@cspell/dict-bash': 4.2.0 - '@cspell/dict-companies': 3.1.12 + '@cspell/dict-companies': 3.1.14 '@cspell/dict-cpp': 5.1.23 '@cspell/dict-cryptocurrencies': 4.0.0 '@cspell/dict-csharp': 4.0.6 @@ -5035,14 +4884,14 @@ snapshots: '@cspell/dict-elixir': 4.0.7 '@cspell/dict-en-common-misspellings': 1.0.2 '@cspell/dict-en-gb': 1.1.33 - '@cspell/dict-en_us': 4.3.29 - '@cspell/dict-filetypes': 3.0.10 + '@cspell/dict-en_us': 4.3.34 + '@cspell/dict-filetypes': 3.0.11 '@cspell/dict-fonts': 4.0.4 '@cspell/dict-fsharp': 1.1.0 - '@cspell/dict-fullstack': 3.2.3 + '@cspell/dict-fullstack': 3.2.6 '@cspell/dict-gaming-terms': 1.1.0 '@cspell/dict-git': 2.0.0 - '@cspell/dict-golang': 6.0.18 + '@cspell/dict-golang': 6.0.19 '@cspell/dict-haskell': 4.0.5 '@cspell/dict-html': 4.0.11 '@cspell/dict-html-symbol-entities': 4.0.3 @@ -5053,13 +4902,13 @@ snapshots: '@cspell/dict-lua': 4.0.7 '@cspell/dict-makefile': 1.0.4 '@cspell/dict-node': 4.0.3 - '@cspell/dict-npm': 5.1.22 + '@cspell/dict-npm': 5.1.30 '@cspell/dict-php': 4.0.14 '@cspell/dict-powershell': 5.0.14 - '@cspell/dict-public-licenses': 2.0.12 - '@cspell/dict-python': 4.2.14 + '@cspell/dict-public-licenses': 2.0.13 + '@cspell/dict-python': 4.2.16 '@cspell/dict-r': 2.1.0 - '@cspell/dict-ruby': 5.0.7 + '@cspell/dict-ruby': 5.0.8 '@cspell/dict-rust': 4.0.11 '@cspell/dict-scala': 5.0.7 '@cspell/dict-software-terms': 3.4.10 @@ -5091,7 +4940,7 @@ snapshots: dependencies: '@cspell/dict-shell': 1.1.0 - '@cspell/dict-companies@3.1.12': {} + '@cspell/dict-companies@3.1.14': {} '@cspell/dict-cpp@5.1.23': {} @@ -5103,7 +4952,7 @@ snapshots: '@cspell/dict-dart@2.3.0': {} - '@cspell/dict-data-science@2.0.6': {} + '@cspell/dict-data-science@2.0.7': {} '@cspell/dict-django@4.1.4': {} @@ -5117,21 +4966,21 @@ snapshots: '@cspell/dict-en-gb@1.1.33': {} - '@cspell/dict-en_us@4.3.29': {} + '@cspell/dict-en_us@4.3.34': {} - '@cspell/dict-filetypes@3.0.10': {} + '@cspell/dict-filetypes@3.0.11': {} '@cspell/dict-fonts@4.0.4': {} '@cspell/dict-fsharp@1.1.0': {} - '@cspell/dict-fullstack@3.2.3': {} + '@cspell/dict-fullstack@3.2.6': {} '@cspell/dict-gaming-terms@1.1.0': {} '@cspell/dict-git@2.0.0': {} - '@cspell/dict-golang@6.0.18': {} + '@cspell/dict-golang@6.0.19': {} '@cspell/dict-haskell@4.0.5': {} @@ -5153,21 +5002,21 @@ snapshots: '@cspell/dict-node@4.0.3': {} - '@cspell/dict-npm@5.1.22': {} + '@cspell/dict-npm@5.1.30': {} '@cspell/dict-php@4.0.14': {} '@cspell/dict-powershell@5.0.14': {} - '@cspell/dict-public-licenses@2.0.12': {} + '@cspell/dict-public-licenses@2.0.13': {} - '@cspell/dict-python@4.2.14': + '@cspell/dict-python@4.2.16': dependencies: - '@cspell/dict-data-science': 2.0.6 + '@cspell/dict-data-science': 2.0.7 '@cspell/dict-r@2.1.0': {} - '@cspell/dict-ruby@5.0.7': {} + '@cspell/dict-ruby@5.0.8': {} '@cspell/dict-rust@4.0.11': {} @@ -5187,247 +5036,195 @@ snapshots: '@cspell/dict-vue@3.0.4': {} - '@cspell/dynamic-import@7.3.9': - dependencies: - import-meta-resolve: 3.1.1 - - '@cspell/strong-weak-map@7.3.9': {} - - '@dabh/diagnostics@2.0.3': - dependencies: - colorspace: 1.1.4 - enabled: 2.0.0 - kuler: 2.0.0 - - '@effect/schema@0.71.1(effect@3.6.5)': - dependencies: - effect: 3.6.5 - fast-check: 3.21.0 - - '@esbuild/aix-ppc64@0.21.5': - optional: true - - '@esbuild/aix-ppc64@0.23.1': - optional: true - - '@esbuild/android-arm64@0.21.5': - optional: true - - '@esbuild/android-arm64@0.23.1': - optional: true - - '@esbuild/android-arm@0.21.5': - optional: true - - '@esbuild/android-arm@0.23.1': - optional: true - - '@esbuild/android-x64@0.21.5': - optional: true - - '@esbuild/android-x64@0.23.1': - optional: true - - '@esbuild/darwin-arm64@0.21.5': - optional: true - - '@esbuild/darwin-arm64@0.23.1': - optional: true - - '@esbuild/darwin-x64@0.21.5': - optional: true - - '@esbuild/darwin-x64@0.23.1': - optional: true - - '@esbuild/freebsd-arm64@0.21.5': - optional: true - - '@esbuild/freebsd-arm64@0.23.1': - optional: true - - '@esbuild/freebsd-x64@0.21.5': - optional: true - - '@esbuild/freebsd-x64@0.23.1': - optional: true - - '@esbuild/linux-arm64@0.21.5': - optional: true - - '@esbuild/linux-arm64@0.23.1': - optional: true - - '@esbuild/linux-arm@0.21.5': - optional: true + '@cspell/dynamic-import@7.3.9': + dependencies: + import-meta-resolve: 3.1.1 - '@esbuild/linux-arm@0.23.1': - optional: true + '@cspell/strong-weak-map@7.3.9': {} - '@esbuild/linux-ia32@0.21.5': - optional: true + '@dabh/diagnostics@2.0.3': + dependencies: + colorspace: 1.1.4 + enabled: 2.0.0 + kuler: 2.0.0 - '@esbuild/linux-ia32@0.23.1': - optional: true + '@effect/schema@0.75.5(effect@3.13.11)': + dependencies: + effect: 3.13.11 + fast-check: 3.23.2 - '@esbuild/linux-loong64@0.21.5': + '@esbuild/aix-ppc64@0.25.1': optional: true - '@esbuild/linux-loong64@0.23.1': + '@esbuild/android-arm64@0.25.1': optional: true - '@esbuild/linux-mips64el@0.21.5': + '@esbuild/android-arm@0.25.1': optional: true - '@esbuild/linux-mips64el@0.23.1': + '@esbuild/android-x64@0.25.1': optional: true - '@esbuild/linux-ppc64@0.21.5': + '@esbuild/darwin-arm64@0.25.1': optional: true - '@esbuild/linux-ppc64@0.23.1': + '@esbuild/darwin-x64@0.25.1': optional: true - '@esbuild/linux-riscv64@0.21.5': + '@esbuild/freebsd-arm64@0.25.1': optional: true - '@esbuild/linux-riscv64@0.23.1': + '@esbuild/freebsd-x64@0.25.1': optional: true - '@esbuild/linux-s390x@0.21.5': + '@esbuild/linux-arm64@0.25.1': optional: true - '@esbuild/linux-s390x@0.23.1': + '@esbuild/linux-arm@0.25.1': optional: true - '@esbuild/linux-x64@0.21.5': + '@esbuild/linux-ia32@0.25.1': optional: true - '@esbuild/linux-x64@0.23.1': + '@esbuild/linux-loong64@0.25.1': optional: true - '@esbuild/netbsd-x64@0.21.5': + '@esbuild/linux-mips64el@0.25.1': optional: true - '@esbuild/netbsd-x64@0.23.1': + '@esbuild/linux-ppc64@0.25.1': optional: true - '@esbuild/openbsd-arm64@0.23.1': + '@esbuild/linux-riscv64@0.25.1': optional: true - '@esbuild/openbsd-x64@0.21.5': + '@esbuild/linux-s390x@0.25.1': optional: true - '@esbuild/openbsd-x64@0.23.1': + '@esbuild/linux-x64@0.25.1': optional: true - '@esbuild/sunos-x64@0.21.5': + '@esbuild/netbsd-arm64@0.25.1': optional: true - '@esbuild/sunos-x64@0.23.1': + '@esbuild/netbsd-x64@0.25.1': optional: true - '@esbuild/win32-arm64@0.21.5': + '@esbuild/openbsd-arm64@0.25.1': optional: true - '@esbuild/win32-arm64@0.23.1': + '@esbuild/openbsd-x64@0.25.1': optional: true - '@esbuild/win32-ia32@0.21.5': + '@esbuild/sunos-x64@0.25.1': optional: true - '@esbuild/win32-ia32@0.23.1': + '@esbuild/win32-arm64@0.25.1': optional: true - '@esbuild/win32-x64@0.21.5': + '@esbuild/win32-ia32@0.25.1': optional: true - '@esbuild/win32-x64@0.23.1': + '@esbuild/win32-x64@0.25.1': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.11.1)': + '@eslint-community/eslint-utils@4.5.1(eslint@9.22.0)': dependencies: - eslint: 9.11.1 + eslint: 9.22.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} - '@eslint/config-array@0.18.0': + '@eslint/config-array@0.19.2': dependencies: - '@eslint/object-schema': 2.1.4 + '@eslint/object-schema': 2.1.6 debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/core@0.6.0': {} + '@eslint/config-helpers@0.1.0': {} + + '@eslint/core@0.12.0': + dependencies: + '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@3.3.0': dependencies: ajv: 6.12.6 debug: 4.4.0 - espree: 10.1.0 + espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 - import-fresh: 3.3.0 + import-fresh: 3.3.1 js-yaml: 4.1.0 minimatch: 3.1.2 strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - '@eslint/js@9.11.1': {} + '@eslint/js@9.22.0': {} - '@eslint/object-schema@2.1.4': {} + '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.2.0': + '@eslint/plugin-kit@0.2.7': dependencies: + '@eslint/core': 0.12.0 levn: 0.4.1 '@fastify/busboy@2.1.1': {} + '@humanfs/core@0.19.1': {} + + '@humanfs/node@0.16.6': + dependencies: + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.0': {} + '@humanwhocodes/retry@0.3.1': {} + + '@humanwhocodes/retry@0.4.2': {} - '@inquirer/checkbox@4.1.2(@types/node@22.10.10)': + '@inquirer/checkbox@4.1.4(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.10.10) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/checkbox@4.1.2(@types/node@22.5.5)': + '@inquirer/checkbox@4.1.4(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/confirm@5.1.6(@types/node@22.10.10)': + '@inquirer/confirm@5.1.8(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) optionalDependencies: '@types/node': 22.10.10 - '@inquirer/confirm@5.1.6(@types/node@22.5.5)': + '@inquirer/confirm@5.1.8(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) optionalDependencies: '@types/node': 22.5.5 - '@inquirer/core@10.1.7(@types/node@22.10.10)': + '@inquirer/core@10.1.9(@types/node@22.10.10)': dependencies: - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.10.10) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -5437,10 +5234,10 @@ snapshots: optionalDependencies: '@types/node': 22.10.10 - '@inquirer/core@10.1.7(@types/node@22.5.5)': + '@inquirer/core@10.1.9(@types/node@22.5.5)': dependencies: - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -5450,173 +5247,173 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/editor@4.2.7(@types/node@22.10.10)': + '@inquirer/editor@4.2.9(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) external-editor: 3.1.0 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/editor@4.2.7(@types/node@22.5.5)': + '@inquirer/editor@4.2.9(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) external-editor: 3.1.0 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/expand@4.0.9(@types/node@22.10.10)': + '@inquirer/expand@4.0.11(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/expand@4.0.9(@types/node@22.5.5)': + '@inquirer/expand@4.0.11(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/figures@1.0.10': {} + '@inquirer/figures@1.0.11': {} - '@inquirer/input@4.1.6(@types/node@22.10.10)': + '@inquirer/input@4.1.8(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) optionalDependencies: '@types/node': 22.10.10 - '@inquirer/input@4.1.6(@types/node@22.5.5)': + '@inquirer/input@4.1.8(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) optionalDependencies: '@types/node': 22.5.5 - '@inquirer/number@3.0.9(@types/node@22.10.10)': + '@inquirer/number@3.0.11(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) optionalDependencies: '@types/node': 22.10.10 - '@inquirer/number@3.0.9(@types/node@22.5.5)': + '@inquirer/number@3.0.11(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) optionalDependencies: '@types/node': 22.5.5 - '@inquirer/password@4.0.9(@types/node@22.10.10)': + '@inquirer/password@4.0.11(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) ansi-escapes: 4.3.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/password@4.0.9(@types/node@22.5.5)': + '@inquirer/password@4.0.11(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/prompts@7.3.2(@types/node@22.10.10)': - dependencies: - '@inquirer/checkbox': 4.1.2(@types/node@22.10.10) - '@inquirer/confirm': 5.1.6(@types/node@22.10.10) - '@inquirer/editor': 4.2.7(@types/node@22.10.10) - '@inquirer/expand': 4.0.9(@types/node@22.10.10) - '@inquirer/input': 4.1.6(@types/node@22.10.10) - '@inquirer/number': 3.0.9(@types/node@22.10.10) - '@inquirer/password': 4.0.9(@types/node@22.10.10) - '@inquirer/rawlist': 4.0.9(@types/node@22.10.10) - '@inquirer/search': 3.0.9(@types/node@22.10.10) - '@inquirer/select': 4.0.9(@types/node@22.10.10) + '@inquirer/prompts@7.4.0(@types/node@22.10.10)': + dependencies: + '@inquirer/checkbox': 4.1.4(@types/node@22.10.10) + '@inquirer/confirm': 5.1.8(@types/node@22.10.10) + '@inquirer/editor': 4.2.9(@types/node@22.10.10) + '@inquirer/expand': 4.0.11(@types/node@22.10.10) + '@inquirer/input': 4.1.8(@types/node@22.10.10) + '@inquirer/number': 3.0.11(@types/node@22.10.10) + '@inquirer/password': 4.0.11(@types/node@22.10.10) + '@inquirer/rawlist': 4.0.11(@types/node@22.10.10) + '@inquirer/search': 3.0.11(@types/node@22.10.10) + '@inquirer/select': 4.1.0(@types/node@22.10.10) optionalDependencies: '@types/node': 22.10.10 - '@inquirer/prompts@7.3.2(@types/node@22.5.5)': - dependencies: - '@inquirer/checkbox': 4.1.2(@types/node@22.5.5) - '@inquirer/confirm': 5.1.6(@types/node@22.5.5) - '@inquirer/editor': 4.2.7(@types/node@22.5.5) - '@inquirer/expand': 4.0.9(@types/node@22.5.5) - '@inquirer/input': 4.1.6(@types/node@22.5.5) - '@inquirer/number': 3.0.9(@types/node@22.5.5) - '@inquirer/password': 4.0.9(@types/node@22.5.5) - '@inquirer/rawlist': 4.0.9(@types/node@22.5.5) - '@inquirer/search': 3.0.9(@types/node@22.5.5) - '@inquirer/select': 4.0.9(@types/node@22.5.5) + '@inquirer/prompts@7.4.0(@types/node@22.5.5)': + dependencies: + '@inquirer/checkbox': 4.1.4(@types/node@22.5.5) + '@inquirer/confirm': 5.1.8(@types/node@22.5.5) + '@inquirer/editor': 4.2.9(@types/node@22.5.5) + '@inquirer/expand': 4.0.11(@types/node@22.5.5) + '@inquirer/input': 4.1.8(@types/node@22.5.5) + '@inquirer/number': 3.0.11(@types/node@22.5.5) + '@inquirer/password': 4.0.11(@types/node@22.5.5) + '@inquirer/rawlist': 4.0.11(@types/node@22.5.5) + '@inquirer/search': 3.0.11(@types/node@22.5.5) + '@inquirer/select': 4.1.0(@types/node@22.5.5) optionalDependencies: '@types/node': 22.5.5 - '@inquirer/rawlist@4.0.9(@types/node@22.10.10)': + '@inquirer/rawlist@4.0.11(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/type': 3.0.5(@types/node@22.10.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/rawlist@4.0.9(@types/node@22.5.5)': + '@inquirer/rawlist@4.0.11(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/search@3.0.9(@types/node@22.10.10)': + '@inquirer/search@3.0.11(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.10.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/search@3.0.9(@types/node@22.5.5)': + '@inquirer/search@3.0.11(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/select@4.0.9(@types/node@22.10.10)': + '@inquirer/select@4.1.0(@types/node@22.10.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.10.10) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.10.10) + '@inquirer/core': 10.1.9(@types/node@22.10.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.10.10) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.10 - '@inquirer/select@4.0.9(@types/node@22.5.5)': + '@inquirer/select@4.1.0(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/type@3.0.4(@types/node@22.10.10)': + '@inquirer/type@3.0.5(@types/node@22.10.10)': optionalDependencies: '@types/node': 22.10.10 - '@inquirer/type@3.0.4(@types/node@22.5.5)': + '@inquirer/type@3.0.5(@types/node@22.5.5)': optionalDependencies: '@types/node': 22.5.5 @@ -5646,27 +5443,40 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@microsoft.azure/autorest.testserver@3.3.50': + '@microsoft.azure/autorest.testserver@3.3.51(rf26q5ggt4rglvdg4e5l33mtfi)': dependencies: - '@azure/storage-blob': 12.25.0 + '@azure/storage-blob': 12.26.0 + '@microsoft.azure/autorest.testserver': '@autorest/python@file:packages/autorest.python(rf26q5ggt4rglvdg4e5l33mtfi)' body-parser: 1.20.3 busboy: 1.6.0 commonmark: 0.30.0 deep-equal: 2.2.3 - express: 4.21.0 - express-promise-router: 4.1.1(express@4.21.0) + express: 4.21.2 + express-promise-router: 4.1.1(express@4.21.2) glob: 8.1.0 js-yaml: 4.1.0 morgan: 1.10.0 mustache: 4.2.0 source-map-support: 0.5.21 underscore: 1.13.7 - winston: 3.14.2 + winston: 3.17.0 xml2js: 0.6.2 yargs: 17.7.2 transitivePeerDependencies: + - '@azure-tools/typespec-autorest' + - '@azure-tools/typespec-azure-core' + - '@azure-tools/typespec-azure-resource-manager' + - '@azure-tools/typespec-azure-rulesets' + - '@azure-tools/typespec-client-generator-core' - '@types/express' + - '@typespec/compiler' + - '@typespec/http' + - '@typespec/openapi' + - '@typespec/rest' + - '@typespec/versioning' + - bufferutil - supports-color + - utf-8-validate '@nodelib/fs.scandir@2.1.5': dependencies: @@ -5678,25 +5488,25 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 + fastq: 1.19.1 '@npmcli/agent@2.2.2': dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.5 + https-proxy-agent: 7.0.6 lru-cache: 10.4.3 - socks-proxy-agent: 8.0.4 + socks-proxy-agent: 8.0.5 transitivePeerDependencies: - supports-color '@npmcli/agent@3.0.0': dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.5 + https-proxy-agent: 7.0.6 lru-cache: 10.4.3 - socks-proxy-agent: 8.0.4 + socks-proxy-agent: 8.0.5 transitivePeerDependencies: - supports-color @@ -5712,7 +5522,7 @@ snapshots: '@npmcli/package-json': 6.1.1 '@npmcli/query': 4.0.0 '@npmcli/redact': 3.1.1 - '@npmcli/run-script': 9.0.2 + '@npmcli/run-script': 9.1.0 bin-links: 5.0.0 cacache: 19.0.1 common-ancestor-path: 1.0.1 @@ -5738,12 +5548,11 @@ snapshots: treeverse: 3.0.0 walk-up-path: 3.0.1 transitivePeerDependencies: - - bluebird - supports-color '@npmcli/fs@3.1.1': dependencies: - semver: 7.6.3 + semver: 7.7.1 '@npmcli/fs@4.0.0': dependencies: @@ -5758,24 +5567,21 @@ snapshots: proc-log: 4.2.0 promise-inflight: 1.0.1 promise-retry: 2.0.1 - semver: 7.6.3 + semver: 7.7.1 which: 4.0.0 transitivePeerDependencies: - bluebird - '@npmcli/git@6.0.1': + '@npmcli/git@6.0.3': dependencies: '@npmcli/promise-spawn': 8.0.2 ini: 5.0.0 lru-cache: 10.4.3 npm-pick-manifest: 10.0.0 proc-log: 5.0.0 - promise-inflight: 1.0.1 promise-retry: 2.0.1 - semver: 7.6.3 + semver: 7.7.1 which: 5.0.0 - transitivePeerDependencies: - - bluebird '@npmcli/installed-package-contents@2.1.0': dependencies: @@ -5793,8 +5599,6 @@ snapshots: '@npmcli/package-json': 6.1.1 glob: 10.4.5 minimatch: 9.0.5 - transitivePeerDependencies: - - bluebird '@npmcli/metavuln-calculator@8.0.1': dependencies: @@ -5804,7 +5608,6 @@ snapshots: proc-log: 5.0.0 semver: 7.6.3 transitivePeerDependencies: - - bluebird - supports-color '@npmcli/name-from-folder@3.0.0': {} @@ -5821,21 +5624,19 @@ snapshots: json-parse-even-better-errors: 3.0.2 normalize-package-data: 6.0.2 proc-log: 4.2.0 - semver: 7.6.3 + semver: 7.7.1 transitivePeerDependencies: - bluebird '@npmcli/package-json@6.1.1': dependencies: - '@npmcli/git': 6.0.1 + '@npmcli/git': 6.0.3 glob: 10.4.5 hosted-git-info: 8.0.2 json-parse-even-better-errors: 4.0.0 proc-log: 5.0.0 semver: 7.6.3 validate-npm-package-license: 3.0.4 - transitivePeerDependencies: - - bluebird '@npmcli/promise-spawn@7.0.2': dependencies: @@ -5858,14 +5659,14 @@ snapshots: '@npmcli/node-gyp': 3.0.0 '@npmcli/package-json': 5.2.1 '@npmcli/promise-spawn': 7.0.2 - node-gyp: 10.2.0 + node-gyp: 10.3.1 proc-log: 4.2.0 which: 4.0.0 transitivePeerDependencies: - bluebird - supports-color - '@npmcli/run-script@9.0.2': + '@npmcli/run-script@9.1.0': dependencies: '@npmcli/node-gyp': 4.0.0 '@npmcli/package-json': 6.1.1 @@ -5874,283 +5675,283 @@ snapshots: proc-log: 5.0.0 which: 5.0.0 transitivePeerDependencies: - - bluebird - supports-color - '@octokit/app@15.1.0': + '@octokit/app@15.1.5': dependencies: - '@octokit/auth-app': 7.1.1 - '@octokit/auth-unauthenticated': 6.1.0 - '@octokit/core': 6.1.2 - '@octokit/oauth-app': 7.1.3 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/types': 13.5.1 - '@octokit/webhooks': 13.3.0 + '@octokit/auth-app': 7.1.5 + '@octokit/auth-unauthenticated': 6.1.2 + '@octokit/core': 6.1.4 + '@octokit/oauth-app': 7.1.6 + '@octokit/plugin-paginate-rest': 11.4.3(@octokit/core@6.1.4) + '@octokit/types': 13.8.0 + '@octokit/webhooks': 13.7.4 - '@octokit/auth-app@7.1.1': + '@octokit/auth-app@7.1.5': dependencies: - '@octokit/auth-oauth-app': 8.1.1 - '@octokit/auth-oauth-user': 5.1.1 - '@octokit/request': 9.1.3 - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 - lru-cache: 10.4.3 + '@octokit/auth-oauth-app': 8.1.3 + '@octokit/auth-oauth-user': 5.1.3 + '@octokit/request': 9.2.2 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 + toad-cache: 3.7.0 universal-github-app-jwt: 2.2.0 universal-user-agent: 7.0.2 - '@octokit/auth-oauth-app@8.1.1': + '@octokit/auth-oauth-app@8.1.3': dependencies: - '@octokit/auth-oauth-device': 7.1.1 - '@octokit/auth-oauth-user': 5.1.1 - '@octokit/request': 9.1.3 - '@octokit/types': 13.5.1 + '@octokit/auth-oauth-device': 7.1.3 + '@octokit/auth-oauth-user': 5.1.3 + '@octokit/request': 9.2.2 + '@octokit/types': 13.8.0 universal-user-agent: 7.0.2 - '@octokit/auth-oauth-device@7.1.1': + '@octokit/auth-oauth-device@7.1.3': dependencies: - '@octokit/oauth-methods': 5.1.2 - '@octokit/request': 9.1.3 - '@octokit/types': 13.5.1 + '@octokit/oauth-methods': 5.1.4 + '@octokit/request': 9.2.2 + '@octokit/types': 13.8.0 universal-user-agent: 7.0.2 - '@octokit/auth-oauth-user@5.1.1': + '@octokit/auth-oauth-user@5.1.3': dependencies: - '@octokit/auth-oauth-device': 7.1.1 - '@octokit/oauth-methods': 5.1.2 - '@octokit/request': 9.1.3 - '@octokit/types': 13.5.1 + '@octokit/auth-oauth-device': 7.1.3 + '@octokit/oauth-methods': 5.1.4 + '@octokit/request': 9.2.2 + '@octokit/types': 13.8.0 universal-user-agent: 7.0.2 '@octokit/auth-token@4.0.0': {} - '@octokit/auth-token@5.1.1': {} + '@octokit/auth-token@5.1.2': {} - '@octokit/auth-unauthenticated@6.1.0': + '@octokit/auth-unauthenticated@6.1.2': dependencies: - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 '@octokit/core@5.2.0': dependencies: '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.1 + '@octokit/graphql': 7.1.1 + '@octokit/request': 8.4.1 + '@octokit/request-error': 5.1.1 + '@octokit/types': 13.8.0 before-after-hook: 2.2.3 universal-user-agent: 6.0.1 - '@octokit/core@6.1.2': + '@octokit/core@6.1.4': dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.3 - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/auth-token': 5.1.2 + '@octokit/graphql': 8.2.1 + '@octokit/request': 9.2.2 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 before-after-hook: 3.0.2 universal-user-agent: 7.0.2 - '@octokit/endpoint@10.1.1': + '@octokit/endpoint@10.1.3': dependencies: - '@octokit/types': 13.5.1 + '@octokit/types': 13.8.0 universal-user-agent: 7.0.2 - '@octokit/endpoint@9.0.5': + '@octokit/endpoint@9.0.6': dependencies: - '@octokit/types': 13.5.1 + '@octokit/types': 13.8.0 universal-user-agent: 6.0.1 - '@octokit/graphql@7.1.0': + '@octokit/graphql@7.1.1': dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.1 + '@octokit/request': 8.4.1 + '@octokit/types': 13.8.0 universal-user-agent: 6.0.1 - '@octokit/graphql@8.1.1': + '@octokit/graphql@8.2.1': dependencies: - '@octokit/request': 9.1.3 - '@octokit/types': 13.5.1 + '@octokit/request': 9.2.2 + '@octokit/types': 13.8.0 universal-user-agent: 7.0.2 - '@octokit/oauth-app@7.1.3': + '@octokit/oauth-app@7.1.6': dependencies: - '@octokit/auth-oauth-app': 8.1.1 - '@octokit/auth-oauth-user': 5.1.1 - '@octokit/auth-unauthenticated': 6.1.0 - '@octokit/core': 6.1.2 + '@octokit/auth-oauth-app': 8.1.3 + '@octokit/auth-oauth-user': 5.1.3 + '@octokit/auth-unauthenticated': 6.1.2 + '@octokit/core': 6.1.4 '@octokit/oauth-authorization-url': 7.1.1 - '@octokit/oauth-methods': 5.1.2 - '@types/aws-lambda': 8.10.145 + '@octokit/oauth-methods': 5.1.4 + '@types/aws-lambda': 8.10.147 universal-user-agent: 7.0.2 '@octokit/oauth-authorization-url@7.1.1': {} - '@octokit/oauth-methods@5.1.2': + '@octokit/oauth-methods@5.1.4': dependencies: '@octokit/oauth-authorization-url': 7.1.1 - '@octokit/request': 9.1.3 - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/request': 9.2.2 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 '@octokit/openapi-types@20.0.0': {} - '@octokit/openapi-types@22.2.0': {} + '@octokit/openapi-types@23.0.1': {} - '@octokit/openapi-webhooks-types@8.3.0': {} + '@octokit/openapi-webhooks-types@10.1.1': {} - '@octokit/plugin-paginate-graphql@5.2.3(@octokit/core@6.1.2)': + '@octokit/plugin-paginate-graphql@5.2.4(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 + '@octokit/core': 6.1.4 - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': + '@octokit/plugin-paginate-rest@11.4.3(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.1 + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': + '@octokit/plugin-paginate-rest@9.2.2(@octokit/core@5.2.0)': dependencies: '@octokit/core': 5.2.0 '@octokit/types': 12.6.0 - '@octokit/plugin-request-log@5.3.1(@octokit/core@6.1.2)': + '@octokit/plugin-request-log@5.3.1(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 + '@octokit/core': 6.1.4 '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': dependencies: '@octokit/core': 5.2.0 '@octokit/types': 12.6.0 - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': + '@octokit/plugin-rest-endpoint-methods@13.3.1(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.1 + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 - '@octokit/plugin-retry@7.1.2(@octokit/core@6.1.2)': + '@octokit/plugin-retry@7.1.4(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/core': 6.1.4 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 bottleneck: 2.19.5 - '@octokit/plugin-throttling@9.3.1(@octokit/core@6.1.2)': + '@octokit/plugin-throttling@9.4.0(@octokit/core@6.1.4)': dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.1 + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 bottleneck: 2.19.5 - '@octokit/request-error@5.1.0': + '@octokit/request-error@5.1.1': dependencies: - '@octokit/types': 13.5.1 + '@octokit/types': 13.8.0 deprecation: 2.3.1 once: 1.4.0 - '@octokit/request-error@6.1.5': + '@octokit/request-error@6.1.7': dependencies: - '@octokit/types': 13.5.1 + '@octokit/types': 13.8.0 - '@octokit/request@8.4.0': + '@octokit/request@8.4.1': dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.1 + '@octokit/endpoint': 9.0.6 + '@octokit/request-error': 5.1.1 + '@octokit/types': 13.8.0 universal-user-agent: 6.0.1 - '@octokit/request@9.1.3': + '@octokit/request@9.2.2': dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/endpoint': 10.1.3 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 + fast-content-type-parse: 2.0.1 universal-user-agent: 7.0.2 - '@octokit/rest@21.0.2': + '@octokit/rest@21.1.1': dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.1(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) + '@octokit/core': 6.1.4 + '@octokit/plugin-paginate-rest': 11.4.3(@octokit/core@6.1.4) + '@octokit/plugin-request-log': 5.3.1(@octokit/core@6.1.4) + '@octokit/plugin-rest-endpoint-methods': 13.3.1(@octokit/core@6.1.4) '@octokit/types@12.6.0': dependencies: '@octokit/openapi-types': 20.0.0 - '@octokit/types@13.5.1': + '@octokit/types@13.8.0': dependencies: - '@octokit/openapi-types': 22.2.0 + '@octokit/openapi-types': 23.0.1 - '@octokit/webhooks-methods@5.1.0': {} + '@octokit/webhooks-methods@5.1.1': {} - '@octokit/webhooks@13.3.0': + '@octokit/webhooks@13.7.4': dependencies: - '@octokit/openapi-webhooks-types': 8.3.0 - '@octokit/request-error': 6.1.5 - '@octokit/webhooks-methods': 5.1.0 + '@octokit/openapi-webhooks-types': 10.1.1 + '@octokit/request-error': 6.1.7 + '@octokit/webhooks-methods': 5.1.1 '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.34.4': + '@rollup/rollup-android-arm-eabi@4.35.0': optional: true - '@rollup/rollup-android-arm64@4.34.4': + '@rollup/rollup-android-arm64@4.35.0': optional: true - '@rollup/rollup-darwin-arm64@4.34.4': + '@rollup/rollup-darwin-arm64@4.35.0': optional: true - '@rollup/rollup-darwin-x64@4.34.4': + '@rollup/rollup-darwin-x64@4.35.0': optional: true - '@rollup/rollup-freebsd-arm64@4.34.4': + '@rollup/rollup-freebsd-arm64@4.35.0': optional: true - '@rollup/rollup-freebsd-x64@4.34.4': + '@rollup/rollup-freebsd-x64@4.35.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.34.4': + '@rollup/rollup-linux-arm-gnueabihf@4.35.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.34.4': + '@rollup/rollup-linux-arm-musleabihf@4.35.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.34.4': + '@rollup/rollup-linux-arm64-gnu@4.35.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.34.4': + '@rollup/rollup-linux-arm64-musl@4.35.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.34.4': + '@rollup/rollup-linux-loongarch64-gnu@4.35.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.34.4': + '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.34.4': + '@rollup/rollup-linux-riscv64-gnu@4.35.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.34.4': + '@rollup/rollup-linux-s390x-gnu@4.35.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.34.4': + '@rollup/rollup-linux-x64-gnu@4.35.0': optional: true - '@rollup/rollup-linux-x64-musl@4.34.4': + '@rollup/rollup-linux-x64-musl@4.35.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.34.4': + '@rollup/rollup-win32-arm64-msvc@4.35.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.34.4': + '@rollup/rollup-win32-ia32-msvc@4.35.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.34.4': + '@rollup/rollup-win32-x64-msvc@4.35.0': optional: true '@rtsao/scc@1.1.0': {} '@sigstore/bundle@2.3.2': dependencies: - '@sigstore/protobuf-specs': 0.3.2 + '@sigstore/protobuf-specs': 0.3.3 '@sigstore/bundle@3.1.0': dependencies: @@ -6160,7 +5961,7 @@ snapshots: '@sigstore/core@2.0.0': {} - '@sigstore/protobuf-specs@0.3.2': {} + '@sigstore/protobuf-specs@0.3.3': {} '@sigstore/protobuf-specs@0.4.0': {} @@ -6168,7 +5969,7 @@ snapshots: dependencies: '@sigstore/bundle': 2.3.2 '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.2 + '@sigstore/protobuf-specs': 0.3.3 make-fetch-happen: 13.0.1 proc-log: 4.2.0 promise-retry: 2.0.1 @@ -6188,7 +5989,7 @@ snapshots: '@sigstore/tuf@2.3.4': dependencies: - '@sigstore/protobuf-specs': 0.3.2 + '@sigstore/protobuf-specs': 0.3.3 tuf-js: 2.2.1 transitivePeerDependencies: - supports-color @@ -6204,7 +6005,7 @@ snapshots: dependencies: '@sigstore/bundle': 2.3.2 '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.2 + '@sigstore/protobuf-specs': 0.3.3 '@sigstore/verify@2.1.0': dependencies: @@ -6214,6 +6015,8 @@ snapshots: '@sindresorhus/merge-streams@2.3.0': {} + '@standard-schema/spec@1.0.0': {} + '@tufjs/canonical-json@2.0.0': {} '@tufjs/models@2.0.1': @@ -6226,7 +6029,7 @@ snapshots: '@tufjs/canonical-json': 2.0.0 minimatch: 9.0.5 - '@types/aws-lambda@8.10.145': {} + '@types/aws-lambda@8.10.147': {} '@types/estree@1.0.6': {} @@ -6267,168 +6070,152 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/eslint-plugin@8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.24.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/type-utils': 8.24.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.24.0 - eslint: 9.11.1 + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/type-utils': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.26.1 + eslint: 9.22.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + ts-api-utils: 2.0.1(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2))(eslint@9.11.1)(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.7.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/type-utils': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.7.0 - eslint: 9.11.1 + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/type-utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.26.1 + eslint: 9.22.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.24.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 - eslint: 9.11.1 - typescript: 5.7.3 + eslint: 9.22.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2)': + '@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.7.3)': dependencies: - '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.7.0 + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 - eslint: 9.11.1 - optionalDependencies: - typescript: 5.6.2 + eslint: 9.22.0 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.24.0': - dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 - - '@typescript-eslint/scope-manager@8.7.0': + '@typescript-eslint/scope-manager@8.26.1': dependencies: - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/visitor-keys': 8.7.0 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/visitor-keys': 8.26.1 - '@typescript-eslint/type-utils@8.24.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/type-utils@8.26.1(eslint@9.22.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.11.1)(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.6.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.6.3) debug: 4.4.0 - eslint: 9.11.1 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + eslint: 9.22.0 + ts-api-utils: 2.0.1(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.7.0(eslint@9.11.1)(typescript@5.6.2)': + '@typescript-eslint/type-utils@8.26.1(eslint@9.22.0)(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1)(typescript@5.6.2) + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.7.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) debug: 4.4.0 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + eslint: 9.22.0 + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - - eslint - supports-color - '@typescript-eslint/types@8.24.0': {} - - '@typescript-eslint/types@8.7.0': {} + '@typescript-eslint/types@8.26.1': {} - '@typescript-eslint/typescript-estree@8.24.0(typescript@5.7.3)': + '@typescript-eslint/typescript-estree@8.26.1(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 - fast-glob: 3.3.2 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + semver: 7.7.1 + ts-api-utils: 2.0.1(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.7.0(typescript@5.6.2)': + '@typescript-eslint/typescript-estree@8.26.1(typescript@5.7.3)': dependencies: - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/visitor-keys': 8.7.0 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 - fast-glob: 3.3.2 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + semver: 7.7.1 + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.24.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/utils@8.26.1(eslint@9.22.0)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) - eslint: 9.11.1 - typescript: 5.7.3 + '@eslint-community/eslint-utils': 4.5.1(eslint@9.22.0) + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.6.3) + eslint: 9.22.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.7.0(eslint@9.11.1)(typescript@5.6.2)': + '@typescript-eslint/utils@8.26.1(eslint@9.22.0)(typescript@5.7.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - eslint: 9.11.1 + '@eslint-community/eslint-utils': 4.5.1(eslint@9.22.0) + '@typescript-eslint/scope-manager': 8.26.1 + '@typescript-eslint/types': 8.26.1 + '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.7.3) + eslint: 9.22.0 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - - typescript - '@typescript-eslint/visitor-keys@8.24.0': + '@typescript-eslint/visitor-keys@8.26.1': dependencies: - '@typescript-eslint/types': 8.24.0 + '@typescript-eslint/types': 8.26.1 eslint-visitor-keys: 4.2.0 - '@typescript-eslint/visitor-keys@8.7.0': - dependencies: - '@typescript-eslint/types': 8.7.0 - eslint-visitor-keys: 3.4.3 - '@typespec/compiler@0.66.0(@types/node@22.10.10)': dependencies: '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.3.2(@types/node@22.10.10) + '@inquirer/prompts': 7.4.0(@types/node@22.10.10) '@npmcli/arborist': 8.0.0 ajv: 8.17.1 change-case: 5.4.4 @@ -6445,13 +6232,12 @@ snapshots: yargs: 17.7.2 transitivePeerDependencies: - '@types/node' - - bluebird - supports-color '@typespec/compiler@0.66.0(@types/node@22.5.5)': dependencies: '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.3.2(@types/node@22.5.5) + '@inquirer/prompts': 7.4.0(@types/node@22.5.5) '@npmcli/arborist': 8.0.0 ajv: 8.17.1 change-case: 5.4.4 @@ -6468,7 +6254,6 @@ snapshots: yargs: 17.7.2 transitivePeerDependencies: - '@types/node' - - bluebird - supports-color '@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': @@ -6495,7 +6280,7 @@ snapshots: marked: 15.0.7 pyodide: 0.26.2 semver: 7.6.3 - tsx: 4.19.2 + tsx: 4.19.3 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -6516,7 +6301,7 @@ snapshots: marked: 15.0.7 pyodide: 0.26.2 semver: 7.6.3 - tsx: 4.19.2 + tsx: 4.19.3 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -6534,7 +6319,6 @@ snapshots: - '@types/express' - '@types/node' - '@typespec/streams' - - bluebird - debug - supports-color @@ -6606,12 +6390,12 @@ snapshots: '@typespec/spec-coverage-sdk': 0.1.0-alpha.3 '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) ajv: 8.17.1 - axios: 1.7.9 + axios: 1.8.3 body-parser: 1.20.3 deep-equal: 2.2.3 express: 4.21.2 express-promise-router: 4.1.1(express@4.21.2) - form-data: 4.0.1 + form-data: 4.0.2 globby: 14.0.2 jackspeak: 4.0.2 js-yaml: 4.1.0 @@ -6627,7 +6411,6 @@ snapshots: - '@types/express' - '@types/node' - '@typespec/streams' - - bluebird - debug - supports-color @@ -6669,43 +6452,43 @@ snapshots: dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@vitest/expect@3.0.5': + '@vitest/expect@3.0.8': dependencies: - '@vitest/spy': 3.0.5 - '@vitest/utils': 3.0.5 - chai: 5.1.2 + '@vitest/spy': 3.0.8 + '@vitest/utils': 3.0.8 + chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.5(vite@5.4.14(@types/node@22.5.5))': + '@vitest/mocker@3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0))': dependencies: - '@vitest/spy': 3.0.5 + '@vitest/spy': 3.0.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.14(@types/node@22.5.5) + vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) - '@vitest/pretty-format@3.0.5': + '@vitest/pretty-format@3.0.8': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.0.5': + '@vitest/runner@3.0.8': dependencies: - '@vitest/utils': 3.0.5 + '@vitest/utils': 3.0.8 pathe: 2.0.3 - '@vitest/snapshot@3.0.5': + '@vitest/snapshot@3.0.8': dependencies: - '@vitest/pretty-format': 3.0.5 + '@vitest/pretty-format': 3.0.8 magic-string: 0.30.17 pathe: 2.0.3 - '@vitest/spy@3.0.5': + '@vitest/spy@3.0.8': dependencies: tinyspy: 3.0.2 - '@vitest/utils@3.0.5': + '@vitest/utils@3.0.8': dependencies: - '@vitest/pretty-format': 3.0.5 + '@vitest/pretty-format': 3.0.8 loupe: 3.1.3 tinyrainbow: 2.0.0 @@ -6718,17 +6501,13 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.14.1): dependencies: - acorn: 8.12.1 + acorn: 8.14.1 - acorn@8.12.1: {} + acorn@8.14.1: {} - agent-base@7.1.1: - dependencies: - debug: 4.4.0 - transitivePeerDependencies: - - supports-color + agent-base@7.1.3: {} aggregate-error@3.1.0: dependencies: @@ -6745,7 +6524,7 @@ snapshots: ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.1 + fast-uri: 3.0.6 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -6769,60 +6548,62 @@ snapshots: argparse@2.0.1: {} - array-buffer-byte-length@1.0.1: + array-buffer-byte-length@1.0.2: dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 + call-bound: 1.0.4 + is-array-buffer: 3.0.5 array-flatten@1.1.1: {} array-includes@3.1.8: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - get-intrinsic: 1.2.4 - is-string: 1.0.7 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + is-string: 1.1.1 array-timsort@1.0.3: {} - array.prototype.findlastindex@1.2.5: + array.prototype.findlastindex@1.2.6: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.9 es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-shim-unscopables: 1.0.2 + es-object-atoms: 1.1.1 + es-shim-unscopables: 1.1.0 - array.prototype.flat@1.3.2: + array.prototype.flat@1.3.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 + es-abstract: 1.23.9 + es-shim-unscopables: 1.1.0 - array.prototype.flatmap@1.3.2: + array.prototype.flatmap@1.3.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 + es-abstract: 1.23.9 + es-shim-unscopables: 1.1.0 - arraybuffer.prototype.slice@1.0.3: + arraybuffer.prototype.slice@1.0.4: dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.9 es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.5 assertion-error@2.0.1: {} + async-function@1.0.0: {} + async@3.2.6: {} asynckit@0.4.0: {} @@ -6831,12 +6612,12 @@ snapshots: available-typed-arrays@1.0.7: dependencies: - possible-typed-array-names: 1.0.0 + possible-typed-array-names: 1.1.0 - axios@1.7.9: + axios@1.8.3: dependencies: follow-redirects: 1.15.9 - form-data: 4.0.1 + form-data: 4.0.2 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug @@ -6891,12 +6672,12 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.24.0: + browserslist@4.24.4: dependencies: - caniuse-lite: 1.0.30001663 - electron-to-chromium: 1.5.28 - node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.24.0) + caniuse-lite: 1.0.30001705 + electron-to-chromium: 1.5.119 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.24.4) buffer-equal-constant-time@1.0.1: {} @@ -6915,7 +6696,7 @@ snapshots: '@bcoe/v8-coverage': 1.0.2 '@istanbuljs/schema': 0.1.3 find-up: 5.0.0 - foreground-child: 3.3.0 + foreground-child: 3.3.1 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-reports: 3.1.7 @@ -6956,19 +6737,28 @@ snapshots: tar: 7.4.3 unique-filename: 4.0.0 - call-bind@1.0.7: + call-bind-apply-helpers@1.0.2: dependencies: - es-define-property: 1.0.0 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.4 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 set-function-length: 1.2.2 + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + callsites@3.1.0: {} - caniuse-lite@1.0.30001663: {} + caniuse-lite@1.0.30001705: {} - chai@5.1.2: + chai@5.2.0: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 @@ -6978,7 +6768,7 @@ snapshots: chalk-template@1.1.0: dependencies: - chalk: 5.3.0 + chalk: 5.4.1 chalk@4.1.2: dependencies: @@ -6987,6 +6777,8 @@ snapshots: chalk@5.3.0: {} + chalk@5.4.1: {} + change-case@5.4.4: {} chardet@0.7.0: {} @@ -6997,7 +6789,7 @@ snapshots: chownr@3.0.0: {} - ci-info@4.0.0: {} + ci-info@4.2.0: {} clean-regexp@1.0.0: dependencies: @@ -7010,9 +6802,9 @@ snapshots: parent-module: 2.0.0 resolve-from: 5.0.0 - cli-cursor@4.0.0: + cli-cursor@5.0.0: dependencies: - restore-cursor: 4.0.0 + restore-cursor: 5.1.0 cli-spinners@2.9.2: {} @@ -7061,7 +6853,7 @@ snapshots: commander@11.1.0: {} - commander@12.1.0: {} + commander@13.1.0: {} comment-json@4.2.5: dependencies: @@ -7107,37 +6899,35 @@ snapshots: cookie-signature@1.0.6: {} - cookie@0.6.0: {} - cookie@0.7.1: {} - core-js-compat@3.38.1: + core-js-compat@3.41.0: dependencies: - browserslist: 4.24.0 + browserslist: 4.24.4 core-util-is@1.0.3: {} cosmiconfig@8.0.0: dependencies: - import-fresh: 3.3.0 + import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 - cosmiconfig@9.0.0(typescript@5.6.2): + cosmiconfig@9.0.0(typescript@5.6.3): dependencies: env-paths: 2.2.1 - import-fresh: 3.3.0 + import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.6.2 + typescript: 5.6.3 cross-env@7.0.3: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -7196,10 +6986,10 @@ snapshots: fast-equals: 5.2.2 find-up: 6.3.0 gensequence: 6.0.0 - import-fresh: 3.3.0 + import-fresh: 3.3.1 resolve-from: 5.0.0 vscode-languageserver-textdocument: 1.0.12 - vscode-uri: 3.0.8 + vscode-uri: 3.1.0 transitivePeerDependencies: - encoding @@ -7215,20 +7005,20 @@ snapshots: '@cspell/cspell-pipe': 7.3.9 '@cspell/cspell-types': 7.3.9 '@cspell/dynamic-import': 7.3.9 - chalk: 5.3.0 + chalk: 5.4.1 chalk-template: 1.1.0 commander: 11.1.0 cspell-gitignore: 7.3.9 cspell-glob: 7.3.9 cspell-io: 7.3.9(encoding@0.1.13) cspell-lib: 7.3.9(encoding@0.1.13) - fast-glob: 3.3.2 + fast-glob: 3.3.3 fast-json-stable-stringify: 2.1.0 file-entry-cache: 7.0.2 get-stdin: 9.0.0 - semver: 7.6.3 + semver: 7.7.1 strip-ansi: 7.1.0 - vscode-uri: 3.0.8 + vscode-uri: 3.1.0 transitivePeerDependencies: - encoding @@ -7236,23 +7026,23 @@ snapshots: data-uri-to-buffer@4.0.1: {} - data-view-buffer@1.0.1: + data-view-buffer@1.0.2: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 - data-view-byte-length@1.0.1: + data-view-byte-length@1.0.2: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 - data-view-byte-offset@1.0.0: + data-view-byte-offset@1.0.1: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 debug@2.6.9: dependencies: @@ -7262,10 +7052,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.7: - dependencies: - ms: 2.1.3 - debug@4.4.0: dependencies: ms: 2.1.3 @@ -7274,32 +7060,32 @@ snapshots: deep-equal@2.2.3: dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 es-get-iterator: 1.1.3 - get-intrinsic: 1.2.4 - is-arguments: 1.1.1 - is-array-buffer: 3.0.4 - is-date-object: 1.0.5 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 + get-intrinsic: 1.3.0 + is-arguments: 1.2.0 + is-array-buffer: 3.0.5 + is-date-object: 1.1.0 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.4 isarray: 2.0.5 object-is: 1.1.6 object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - side-channel: 1.0.6 - which-boxed-primitive: 1.0.2 + object.assign: 4.1.7 + regexp.prototype.flags: 1.5.4 + side-channel: 1.1.0 + which-boxed-primitive: 1.1.1 which-collection: 1.0.2 - which-typed-array: 1.1.15 + which-typed-array: 1.1.19 deep-is@0.1.4: {} define-data-property@1.1.4: dependencies: - es-define-property: 1.0.0 + es-define-property: 1.0.1 es-errors: 1.3.0 - gopd: 1.0.1 + gopd: 1.2.0 define-lazy-prop@2.0.0: {} @@ -7325,6 +7111,12 @@ snapshots: dependencies: is-obj: 2.0.0 + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + eastasianwidth@0.2.0: {} ecdsa-sig-formatter@1.0.11: @@ -7333,9 +7125,12 @@ snapshots: ee-first@1.1.1: {} - effect@3.6.5: {} + effect@3.13.11: + dependencies: + '@standard-schema/spec': 1.0.0 + fast-check: 3.23.2 - electron-to-chromium@1.5.28: {} + electron-to-chromium@1.5.119: {} emoji-regex@10.4.0: {} @@ -7369,147 +7164,126 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es-abstract@1.23.3: + es-abstract@1.23.9: dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - data-view-buffer: 1.0.1 - data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 - es-define-property: 1.0.0 + call-bind: 1.0.8 + call-bound: 1.0.4 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 + es-object-atoms: 1.1.1 + es-set-tostringtag: 2.1.0 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.8 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + get-symbol-description: 1.1.0 globalthis: 1.0.4 - gopd: 1.0.1 + gopd: 1.2.0 has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 + has-proto: 1.2.0 + has-symbols: 1.1.0 hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 is-callable: 1.2.7 - is-data-view: 1.0.1 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.2 + is-data-view: 1.0.2 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.1 + math-intrinsics: 1.1.0 + object-inspect: 1.13.4 object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 + object.assign: 4.1.7 + own-keys: 1.0.1 + regexp.prototype.flags: 1.5.4 + safe-array-concat: 1.1.3 + safe-push-apply: 1.0.0 + safe-regex-test: 1.1.0 + set-proto: 1.0.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.6 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.19 - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 + es-define-property@1.0.1: {} es-errors@1.3.0: {} es-get-iterator@1.1.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - is-arguments: 1.1.1 + call-bind: 1.0.8 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 + is-arguments: 1.2.0 is-map: 2.0.3 is-set: 2.0.3 - is-string: 1.0.7 + is-string: 1.1.1 isarray: 2.0.5 - stop-iteration-iterator: 1.0.0 + stop-iteration-iterator: 1.1.0 es-module-lexer@1.6.0: {} - es-object-atoms@1.0.0: + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 - es-set-tostringtag@2.0.3: + es-set-tostringtag@2.1.0: dependencies: - get-intrinsic: 1.2.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 - es-shim-unscopables@1.0.2: + es-shim-unscopables@1.1.0: dependencies: hasown: 2.0.2 - es-to-primitive@1.2.1: + es-to-primitive@1.3.0: dependencies: is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 + is-date-object: 1.1.0 + is-symbol: 1.1.1 - esbuild@0.21.5: + esbuild@0.25.1: optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 - - esbuild@0.23.1: - optionalDependencies: - '@esbuild/aix-ppc64': 0.23.1 - '@esbuild/android-arm': 0.23.1 - '@esbuild/android-arm64': 0.23.1 - '@esbuild/android-x64': 0.23.1 - '@esbuild/darwin-arm64': 0.23.1 - '@esbuild/darwin-x64': 0.23.1 - '@esbuild/freebsd-arm64': 0.23.1 - '@esbuild/freebsd-x64': 0.23.1 - '@esbuild/linux-arm': 0.23.1 - '@esbuild/linux-arm64': 0.23.1 - '@esbuild/linux-ia32': 0.23.1 - '@esbuild/linux-loong64': 0.23.1 - '@esbuild/linux-mips64el': 0.23.1 - '@esbuild/linux-ppc64': 0.23.1 - '@esbuild/linux-riscv64': 0.23.1 - '@esbuild/linux-s390x': 0.23.1 - '@esbuild/linux-x64': 0.23.1 - '@esbuild/netbsd-x64': 0.23.1 - '@esbuild/openbsd-arm64': 0.23.1 - '@esbuild/openbsd-x64': 0.23.1 - '@esbuild/sunos-x64': 0.23.1 - '@esbuild/win32-arm64': 0.23.1 - '@esbuild/win32-ia32': 0.23.1 - '@esbuild/win32-x64': 0.23.1 + '@esbuild/aix-ppc64': 0.25.1 + '@esbuild/android-arm': 0.25.1 + '@esbuild/android-arm64': 0.25.1 + '@esbuild/android-x64': 0.25.1 + '@esbuild/darwin-arm64': 0.25.1 + '@esbuild/darwin-x64': 0.25.1 + '@esbuild/freebsd-arm64': 0.25.1 + '@esbuild/freebsd-x64': 0.25.1 + '@esbuild/linux-arm': 0.25.1 + '@esbuild/linux-arm64': 0.25.1 + '@esbuild/linux-ia32': 0.25.1 + '@esbuild/linux-loong64': 0.25.1 + '@esbuild/linux-mips64el': 0.25.1 + '@esbuild/linux-ppc64': 0.25.1 + '@esbuild/linux-riscv64': 0.25.1 + '@esbuild/linux-s390x': 0.25.1 + '@esbuild/linux-x64': 0.25.1 + '@esbuild/netbsd-arm64': 0.25.1 + '@esbuild/netbsd-x64': 0.25.1 + '@esbuild/openbsd-arm64': 0.25.1 + '@esbuild/openbsd-x64': 0.25.1 + '@esbuild/sunos-x64': 0.25.1 + '@esbuild/win32-arm64': 0.25.1 + '@esbuild/win32-ia32': 0.25.1 + '@esbuild/win32-x64': 0.25.1 escalade@3.2.0: {} @@ -7522,102 +7296,102 @@ snapshots: eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 - is-core-module: 2.15.1 - resolve: 1.22.8 + is-core-module: 2.16.1 + resolve: 1.22.10 transitivePeerDependencies: - supports-color - eslint-module-utils@2.11.1(@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@9.22.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - eslint: 9.11.1 + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + eslint: 9.22.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2))(eslint@9.11.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 - array.prototype.findlastindex: 1.2.5 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 + array.prototype.findlastindex: 1.2.6 + array.prototype.flat: 1.3.3 + array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.11.1 + eslint: 9.22.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.11.1(@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@9.22.0) hasown: 2.0.2 - is-core-module: 2.15.1 + is-core-module: 2.16.1 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 object.groupby: 1.0.3 - object.values: 1.2.0 + object.values: 1.2.1 semver: 6.3.1 + string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1)(typescript@5.6.2) + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.6.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-unicorn@55.0.0(eslint@9.11.1): + eslint-plugin-unicorn@55.0.0(eslint@9.22.0): dependencies: - '@babel/helper-validator-identifier': 7.24.7 - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - ci-info: 4.0.0 + '@babel/helper-validator-identifier': 7.25.9 + '@eslint-community/eslint-utils': 4.5.1(eslint@9.22.0) + ci-info: 4.2.0 clean-regexp: 1.0.0 - core-js-compat: 3.38.1 - eslint: 9.11.1 + core-js-compat: 3.41.0 + eslint: 9.22.0 esquery: 1.6.0 - globals: 15.9.0 + globals: 15.15.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 - jsesc: 3.0.2 + jsesc: 3.1.0 pluralize: 8.0.0 read-pkg-up: 7.0.1 regexp-tree: 0.1.27 regjsparser: 0.10.0 - semver: 7.6.3 + semver: 7.7.1 strip-indent: 3.0.0 - eslint-scope@8.0.2: + eslint-scope@8.3.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.0.0: {} - eslint-visitor-keys@4.2.0: {} - eslint@9.11.1: - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - '@eslint-community/regexpp': 4.11.1 - '@eslint/config-array': 0.18.0 - '@eslint/core': 0.6.0 - '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.11.1 - '@eslint/plugin-kit': 0.2.0 + eslint@9.22.0: + dependencies: + '@eslint-community/eslint-utils': 4.5.1(eslint@9.22.0) + '@eslint-community/regexpp': 4.12.1 + '@eslint/config-array': 0.19.2 + '@eslint/config-helpers': 0.1.0 + '@eslint/core': 0.12.0 + '@eslint/eslintrc': 3.3.0 + '@eslint/js': 9.22.0 + '@eslint/plugin-kit': 0.2.7 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.0 - '@nodelib/fs.walk': 1.2.8 + '@humanwhocodes/retry': 0.4.2 '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.7 + cross-spawn: 7.0.6 + debug: 4.4.0 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.2 - eslint-visitor-keys: 4.0.0 - espree: 10.1.0 + eslint-scope: 8.3.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -7627,22 +7401,19 @@ snapshots: ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 json-stable-stringify-without-jsonify: 1.0.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 transitivePeerDependencies: - supports-color - espree@10.1.0: + espree@10.3.0: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.0.0 + acorn: 8.14.1 + acorn-jsx: 5.3.2(acorn@8.14.1) + eslint-visitor-keys: 4.2.0 esprima@4.0.1: {} @@ -7666,16 +7437,9 @@ snapshots: events@3.3.0: {} - expect-type@1.1.0: {} + expect-type@1.2.0: {} - exponential-backoff@3.1.1: {} - - express-promise-router@4.1.1(express@4.21.0): - dependencies: - express: 4.21.0 - is-promise: 4.0.0 - lodash.flattendeep: 4.4.0 - methods: 1.1.2 + exponential-backoff@3.1.2: {} express-promise-router@4.1.1(express@4.21.2): dependencies: @@ -7684,42 +7448,6 @@ snapshots: lodash.flattendeep: 4.4.0 methods: 1.1.2 - express@4.21.0: - dependencies: - accepts: 1.3.8 - array-flatten: 1.1.1 - body-parser: 1.20.3 - content-disposition: 0.5.4 - content-type: 1.0.5 - cookie: 0.6.0 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - encodeurl: 2.0.0 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 1.3.1 - fresh: 0.5.2 - http-errors: 2.0.0 - merge-descriptors: 1.0.3 - methods: 1.1.2 - on-finished: 2.4.1 - parseurl: 1.3.3 - path-to-regexp: 0.1.10 - proxy-addr: 2.0.7 - qs: 6.13.0 - range-parser: 1.2.1 - safe-buffer: 5.2.1 - send: 0.19.0 - serve-static: 1.16.2 - setprototypeof: 1.2.0 - statuses: 2.0.1 - type-is: 1.6.18 - utils-merge: 1.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - express@4.21.2: dependencies: accepts: 1.3.8 @@ -7762,17 +7490,19 @@ snapshots: iconv-lite: 0.4.24 tmp: 0.0.33 - fast-check@3.21.0: + fast-check@3.23.2: dependencies: pure-rand: 6.1.0 + fast-content-type-parse@2.0.1: {} + fast-deep-equal@3.1.3: {} fast-equals@4.0.3: {} fast-equals@5.2.2: {} - fast-glob@3.3.2: + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 @@ -7784,15 +7514,15 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-uri@3.0.1: {} + fast-uri@3.0.6: {} - fast-xml-parser@4.5.0: + fast-xml-parser@5.0.9: dependencies: - strnum: 1.0.5 + strnum: 2.0.5 - fastq@1.17.1: + fastq@1.19.1: dependencies: - reusify: 1.0.4 + reusify: 1.1.0 fecha@4.2.3: {} @@ -7842,34 +7572,35 @@ snapshots: flat-cache@3.2.0: dependencies: - flatted: 3.3.1 + flatted: 3.3.3 keyv: 4.5.4 rimraf: 3.0.2 flat-cache@4.0.1: dependencies: - flatted: 3.3.1 + flatted: 3.3.3 keyv: 4.5.4 - flatted@3.3.1: {} + flatted@3.3.3: {} fn.name@1.1.0: {} follow-redirects@1.15.9: {} - for-each@0.3.3: + for-each@0.3.5: dependencies: is-callable: 1.2.7 - foreground-child@3.3.0: + foreground-child@3.3.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.1: + form-data@4.0.2: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 mime-types: 2.1.35 formdata-polyfill@4.0.10: @@ -7901,12 +7632,14 @@ snapshots: function-bind@1.1.2: {} - function.prototype.name@1.1.6: + function.prototype.name@1.1.8: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.3 functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 functions-have-names@1.2.3: {} @@ -7914,25 +7647,35 @@ snapshots: get-caller-file@2.0.5: {} - get-east-asian-width@1.2.0: {} + get-east-asian-width@1.3.0: {} - get-intrinsic@1.2.4: + get-intrinsic@1.3.0: dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 es-errors: 1.3.0 + es-object-atoms: 1.1.1 function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 get-stdin@9.0.0: {} - get-symbol-description@1.0.2: + get-symbol-description@1.1.0: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 es-errors: 1.3.0 - get-intrinsic: 1.2.4 + get-intrinsic: 1.3.0 - get-tsconfig@4.8.1: + get-tsconfig@4.10.0: dependencies: resolve-pkg-maps: 1.0.0 @@ -7946,20 +7689,20 @@ snapshots: glob@10.4.5: dependencies: - foreground-child: 3.3.0 + foreground-child: 3.3.1 jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 - package-json-from-dist: 1.0.0 + package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - glob@11.0.0: + glob@11.0.1: dependencies: - foreground-child: 3.3.0 - jackspeak: 4.0.1 + foreground-child: 3.3.1 + jackspeak: 4.1.0 minimatch: 10.0.1 minipass: 7.1.2 - package-json-from-dist: 1.0.0 + package-json-from-dist: 1.0.1 path-scurry: 2.0.0 glob@7.2.3: @@ -7985,31 +7728,38 @@ snapshots: globals@14.0.0: {} - globals@15.9.0: {} + globals@15.15.0: {} globalthis@1.0.4: dependencies: define-properties: 1.2.1 - gopd: 1.0.1 + gopd: 1.2.0 globby@14.0.2: dependencies: '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 + fast-glob: 3.3.3 ignore: 5.3.2 path-type: 5.0.0 slash: 5.1.0 unicorn-magic: 0.1.0 - gopd@1.0.1: + globby@14.1.0: dependencies: - get-intrinsic: 1.2.4 + '@sindresorhus/merge-streams': 2.3.0 + fast-glob: 3.3.3 + ignore: 7.0.3 + path-type: 6.0.0 + slash: 5.1.0 + unicorn-magic: 0.3.0 + + gopd@1.2.0: {} graceful-fs@4.2.11: {} graphemer@1.4.0: {} - has-bigints@1.0.2: {} + has-bigints@1.1.0: {} has-flag@4.0.0: {} @@ -8017,15 +7767,17 @@ snapshots: has-property-descriptors@1.0.2: dependencies: - es-define-property: 1.0.0 + es-define-property: 1.0.1 - has-proto@1.0.3: {} + has-proto@1.2.0: + dependencies: + dunder-proto: 1.0.1 - has-symbols@1.0.3: {} + has-symbols@1.1.0: {} has-tostringtag@1.0.2: dependencies: - has-symbols: 1.0.3 + has-symbols: 1.1.0 hasown@2.0.2: dependencies: @@ -8055,14 +7807,14 @@ snapshots: http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 debug: 4.4.0 transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.5: + https-proxy-agent@7.0.6: dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -8086,7 +7838,9 @@ snapshots: ignore@5.3.2: {} - import-fresh@3.3.0: + ignore@7.0.3: {} + + import-fresh@3.3.1: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 @@ -8110,11 +7864,11 @@ snapshots: ini@5.0.0: {} - internal-slot@1.0.7: + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 hasown: 2.0.2 - side-channel: 1.0.6 + side-channel: 1.1.0 ip-address@9.0.5: dependencies: @@ -8123,27 +7877,36 @@ snapshots: ipaddr.js@1.9.1: {} - is-arguments@1.1.1: + is-arguments@1.2.0: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 has-tostringtag: 1.0.2 - is-array-buffer@3.0.4: + is-array-buffer@3.0.5: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 is-arrayish@0.2.1: {} is-arrayish@0.3.2: {} - is-bigint@1.0.4: + is-async-function@2.1.1: + dependencies: + async-function: 1.0.0 + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + + is-bigint@1.1.0: dependencies: - has-bigints: 1.0.2 + has-bigints: 1.1.0 - is-boolean-object@1.1.2: + is-boolean-object@1.2.2: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 has-tostringtag: 1.0.2 is-builtin-module@3.2.1: @@ -8152,24 +7915,38 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.15.1: + is-core-module@2.16.1: dependencies: hasown: 2.0.2 - is-data-view@1.0.1: + is-data-view@1.0.2: dependencies: - is-typed-array: 1.1.13 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + is-typed-array: 1.1.15 - is-date-object@1.0.5: + is-date-object@1.1.0: dependencies: + call-bound: 1.0.4 has-tostringtag: 1.0.2 is-docker@2.2.1: {} is-extglob@2.1.1: {} + is-finalizationregistry@1.1.1: + dependencies: + call-bound: 1.0.4 + is-fullwidth-code-point@3.0.0: {} + is-generator-function@1.1.0: + dependencies: + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -8180,44 +7957,46 @@ snapshots: is-map@2.0.3: {} - is-negative-zero@2.0.3: {} - - is-number-object@1.0.7: + is-number-object@1.1.1: dependencies: + call-bound: 1.0.4 has-tostringtag: 1.0.2 is-number@7.0.0: {} is-obj@2.0.0: {} - is-path-inside@3.0.3: {} - is-promise@4.0.0: {} - is-regex@1.1.4: + is-regex@1.2.1: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 + gopd: 1.2.0 has-tostringtag: 1.0.2 + hasown: 2.0.2 is-set@2.0.3: {} - is-shared-array-buffer@1.0.3: + is-shared-array-buffer@1.0.4: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 is-stream@2.0.1: {} - is-string@1.0.7: + is-string@1.1.1: dependencies: + call-bound: 1.0.4 has-tostringtag: 1.0.2 - is-symbol@1.0.4: + is-symbol@1.1.1: dependencies: - has-symbols: 1.0.3 + call-bound: 1.0.4 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 - is-typed-array@1.1.13: + is-typed-array@1.1.15: dependencies: - which-typed-array: 1.1.15 + which-typed-array: 1.1.19 is-typedarray@1.0.0: {} @@ -8227,14 +8006,14 @@ snapshots: is-weakmap@2.0.2: {} - is-weakref@1.0.2: + is-weakref@1.1.1: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 - is-weakset@2.0.3: + is-weakset@2.0.4: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 is-wsl@2.2.0: dependencies: @@ -8267,13 +8046,11 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.0.1: + jackspeak@4.0.2: dependencies: '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - jackspeak@4.0.2: + jackspeak@4.1.0: dependencies: '@isaacs/cliui': 8.0.2 @@ -8287,7 +8064,7 @@ snapshots: jsesc@0.5.0: {} - jsesc@3.0.2: {} + jsesc@3.1.0: {} json-buffer@3.0.1: {} @@ -8405,18 +8182,9 @@ snapshots: log-symbols@6.0.0: dependencies: - chalk: 5.3.0 + chalk: 5.4.1 is-unicode-supported: 1.3.0 - logform@2.6.1: - dependencies: - '@colors/colors': 1.6.0 - '@types/triple-beam': 1.3.5 - fecha: 4.2.3 - ms: 2.1.3 - safe-stable-stringify: 2.5.0 - triple-beam: 1.4.1 - logform@2.7.0: dependencies: '@colors/colors': 1.6.0 @@ -8430,7 +8198,7 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.0.1: {} + lru-cache@11.0.2: {} magic-string@0.30.17: dependencies: @@ -8450,7 +8218,7 @@ snapshots: minipass-fetch: 3.0.5 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - negotiator: 0.6.3 + negotiator: 0.6.4 proc-log: 4.2.0 promise-retry: 2.0.1 ssri: 10.0.6 @@ -8463,7 +8231,7 @@ snapshots: cacache: 19.0.1 http-cache-semantics: 4.1.1 minipass: 7.1.2 - minipass-fetch: 4.0.0 + minipass-fetch: 4.0.1 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 negotiator: 1.0.0 @@ -8475,6 +8243,8 @@ snapshots: marked@15.0.7: {} + math-intrinsics@1.1.0: {} + mdurl@1.0.1: {} media-typer@0.3.0: {} @@ -8498,7 +8268,7 @@ snapshots: mime@1.6.0: {} - mimic-fn@2.1.0: {} + mimic-function@5.0.1: {} min-indent@1.0.1: {} @@ -8532,7 +8302,7 @@ snapshots: optionalDependencies: encoding: 0.1.13 - minipass-fetch@4.0.0: + minipass-fetch@4.0.1: dependencies: minipass: 7.1.2 minipass-sized: 1.0.3 @@ -8606,12 +8376,14 @@ snapshots: mute-stream@2.0.0: {} - nanoid@3.3.8: {} + nanoid@3.3.10: {} natural-compare@1.4.0: {} negotiator@0.6.3: {} + negotiator@0.6.4: {} + negotiator@1.0.0: {} node-domexception@1.0.0: {} @@ -8628,16 +8400,16 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - node-gyp@10.2.0: + node-gyp@10.3.1: dependencies: env-paths: 2.2.1 - exponential-backoff: 3.1.1 + exponential-backoff: 3.1.2 glob: 10.4.5 graceful-fs: 4.2.11 make-fetch-happen: 13.0.1 nopt: 7.2.1 proc-log: 4.2.0 - semver: 7.6.3 + semver: 7.7.1 tar: 6.2.1 which: 4.0.0 transitivePeerDependencies: @@ -8646,7 +8418,7 @@ snapshots: node-gyp@11.1.0: dependencies: env-paths: 2.2.1 - exponential-backoff: 3.1.1 + exponential-backoff: 3.1.2 glob: 10.4.5 graceful-fs: 4.2.11 make-fetch-happen: 14.0.3 @@ -8658,7 +8430,7 @@ snapshots: transitivePeerDependencies: - supports-color - node-releases@2.0.18: {} + node-releases@2.0.19: {} nopt@7.2.1: dependencies: @@ -8671,14 +8443,14 @@ snapshots: normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.8 + resolve: 1.22.10 semver: 5.7.2 validate-npm-package-license: 3.0.4 normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 - semver: 7.6.3 + semver: 7.7.1 validate-npm-package-license: 3.0.4 npm-bundled@3.0.1: @@ -8691,7 +8463,7 @@ snapshots: npm-install-checks@6.3.0: dependencies: - semver: 7.6.3 + semver: 7.7.1 npm-install-checks@7.1.1: dependencies: @@ -8705,14 +8477,14 @@ snapshots: dependencies: hosted-git-info: 7.0.2 proc-log: 4.2.0 - semver: 7.6.3 + semver: 7.7.1 validate-npm-package-name: 5.0.1 npm-package-arg@12.0.2: dependencies: hosted-git-info: 8.0.2 proc-log: 5.0.0 - semver: 7.6.3 + semver: 7.7.1 validate-npm-package-name: 6.0.0 npm-packlist@8.0.2: @@ -8735,7 +8507,7 @@ snapshots: npm-install-checks: 6.3.0 npm-normalize-package-bin: 3.0.1 npm-package-arg: 11.0.3 - semver: 7.6.3 + semver: 7.7.1 npm-registry-fetch@17.1.0: dependencies: @@ -8756,7 +8528,7 @@ snapshots: jsonparse: 1.3.1 make-fetch-happen: 14.0.3 minipass: 7.1.2 - minipass-fetch: 4.0.0 + minipass-fetch: 4.0.1 minizlib: 3.0.1 npm-package-arg: 12.0.2 proc-log: 5.0.0 @@ -8765,53 +8537,56 @@ snapshots: object-assign@4.1.1: {} - object-inspect@1.13.2: {} + object-inspect@1.13.4: {} object-is@1.1.6: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 object-keys@1.1.1: {} - object.assign@4.1.5: + object.assign@4.1.7: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - has-symbols: 1.0.3 + es-object-atoms: 1.1.1 + has-symbols: 1.1.0 object-keys: 1.1.1 object.fromentries@2.0.8: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 object.groupby@1.0.3: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.9 - object.values@1.2.0: + object.values@1.2.1: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 - octokit@4.0.2: + octokit@4.1.2: dependencies: - '@octokit/app': 15.1.0 - '@octokit/core': 6.1.2 - '@octokit/oauth-app': 7.1.3 - '@octokit/plugin-paginate-graphql': 5.2.3(@octokit/core@6.1.2) - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - '@octokit/plugin-retry': 7.1.2(@octokit/core@6.1.2) - '@octokit/plugin-throttling': 9.3.1(@octokit/core@6.1.2) - '@octokit/request-error': 6.1.5 - '@octokit/types': 13.5.1 + '@octokit/app': 15.1.5 + '@octokit/core': 6.1.4 + '@octokit/oauth-app': 7.1.6 + '@octokit/plugin-paginate-graphql': 5.2.4(@octokit/core@6.1.4) + '@octokit/plugin-paginate-rest': 11.4.3(@octokit/core@6.1.4) + '@octokit/plugin-rest-endpoint-methods': 13.3.1(@octokit/core@6.1.4) + '@octokit/plugin-retry': 7.1.4(@octokit/core@6.1.4) + '@octokit/plugin-throttling': 9.4.0(@octokit/core@6.1.4) + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 on-finished@2.3.0: dependencies: @@ -8831,9 +8606,9 @@ snapshots: dependencies: fn.name: 1.1.0 - onetime@5.1.2: + onetime@7.0.0: dependencies: - mimic-fn: 2.1.0 + mimic-function: 5.0.1 open@8.4.2: dependencies: @@ -8850,10 +8625,10 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - ora@8.0.1: + ora@8.2.0: dependencies: - chalk: 5.3.0 - cli-cursor: 4.0.0 + chalk: 5.4.1 + cli-cursor: 5.0.0 cli-spinners: 2.9.2 is-interactive: 2.0.0 is-unicode-supported: 2.1.0 @@ -8864,6 +8639,12 @@ snapshots: os-tmpdir@1.0.2: {} + own-keys@1.0.1: + dependencies: + get-intrinsic: 1.3.0 + object-keys: 1.1.1 + safe-push-apply: 1.0.0 + p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -8874,7 +8655,7 @@ snapshots: p-limit@4.0.0: dependencies: - yocto-queue: 1.1.1 + yocto-queue: 1.2.0 p-locate@4.1.0: dependencies: @@ -8896,7 +8677,7 @@ snapshots: p-try@2.2.0: {} - package-json-from-dist@1.0.0: {} + package-json-from-dist@1.0.1: {} pacote@18.0.6: dependencies: @@ -8923,11 +8704,11 @@ snapshots: pacote@19.0.1: dependencies: - '@npmcli/git': 6.0.1 + '@npmcli/git': 6.0.3 '@npmcli/installed-package-contents': 3.0.0 '@npmcli/package-json': 6.1.1 '@npmcli/promise-spawn': 8.0.2 - '@npmcli/run-script': 9.0.2 + '@npmcli/run-script': 9.1.0 cacache: 19.0.1 fs-minipass: 3.0.3 minipass: 7.1.2 @@ -8941,16 +8722,15 @@ snapshots: ssri: 12.0.0 tar: 6.2.1 transitivePeerDependencies: - - bluebird - supports-color pacote@20.0.0: dependencies: - '@npmcli/git': 6.0.1 + '@npmcli/git': 6.0.3 '@npmcli/installed-package-contents': 3.0.0 '@npmcli/package-json': 6.1.1 '@npmcli/promise-spawn': 8.0.2 - '@npmcli/run-script': 9.0.2 + '@npmcli/run-script': 9.1.0 cacache: 19.0.1 fs-minipass: 3.0.3 minipass: 7.1.2 @@ -8964,7 +8744,6 @@ snapshots: ssri: 12.0.0 tar: 6.2.1 transitivePeerDependencies: - - bluebird - supports-color parent-module@1.0.1: @@ -9007,39 +8786,37 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.0.1 + lru-cache: 11.0.2 minipass: 7.1.2 - path-to-regexp@0.1.10: {} - path-to-regexp@0.1.12: {} path-type@4.0.0: {} path-type@5.0.0: {} + path-type@6.0.0: {} + pathe@2.0.3: {} pathval@2.0.0: {} - picocolors@1.1.0: {} - picocolors@1.1.1: {} picomatch@2.3.1: {} pluralize@8.0.0: {} - possible-typed-array-names@1.0.0: {} + possible-typed-array-names@1.1.0: {} postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - postcss@8.5.1: + postcss@8.5.3: dependencies: - nanoid: 3.3.8 + nanoid: 3.3.10 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -9086,14 +8863,14 @@ snapshots: pyodide@0.26.2: dependencies: - ws: 8.18.0 + ws: 8.18.1 transitivePeerDependencies: - bufferutil - utf-8-validate qs@6.13.0: dependencies: - side-channel: 1.0.6 + side-channel: 1.1.0 queue-microtask@1.2.3: {} @@ -9147,13 +8924,26 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 + reflect.getprototypeof@1.0.10: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + which-builtin-type: 1.2.1 + regexp-tree@0.1.27: {} - regexp.prototype.flags@1.5.2: + regexp.prototype.flags@1.5.4: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-errors: 1.3.0 + get-proto: 1.0.1 + gopd: 1.2.0 set-function-name: 2.0.2 regjsparser@0.10.0: @@ -9172,20 +8962,20 @@ snapshots: resolve-pkg-maps@1.0.0: {} - resolve@1.22.8: + resolve@1.22.10: dependencies: - is-core-module: 2.15.1 + is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - restore-cursor@4.0.0: + restore-cursor@5.1.0: dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 + onetime: 7.0.0 + signal-exit: 4.1.0 retry@0.12.0: {} - reusify@1.0.4: {} + reusify@1.1.0: {} rimraf@3.0.2: dependencies: @@ -9197,54 +8987,60 @@ snapshots: rimraf@6.0.1: dependencies: - glob: 11.0.0 - package-json-from-dist: 1.0.0 + glob: 11.0.1 + package-json-from-dist: 1.0.1 - rollup@4.34.4: + rollup@4.35.0: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.34.4 - '@rollup/rollup-android-arm64': 4.34.4 - '@rollup/rollup-darwin-arm64': 4.34.4 - '@rollup/rollup-darwin-x64': 4.34.4 - '@rollup/rollup-freebsd-arm64': 4.34.4 - '@rollup/rollup-freebsd-x64': 4.34.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.34.4 - '@rollup/rollup-linux-arm-musleabihf': 4.34.4 - '@rollup/rollup-linux-arm64-gnu': 4.34.4 - '@rollup/rollup-linux-arm64-musl': 4.34.4 - '@rollup/rollup-linux-loongarch64-gnu': 4.34.4 - '@rollup/rollup-linux-powerpc64le-gnu': 4.34.4 - '@rollup/rollup-linux-riscv64-gnu': 4.34.4 - '@rollup/rollup-linux-s390x-gnu': 4.34.4 - '@rollup/rollup-linux-x64-gnu': 4.34.4 - '@rollup/rollup-linux-x64-musl': 4.34.4 - '@rollup/rollup-win32-arm64-msvc': 4.34.4 - '@rollup/rollup-win32-ia32-msvc': 4.34.4 - '@rollup/rollup-win32-x64-msvc': 4.34.4 + '@rollup/rollup-android-arm-eabi': 4.35.0 + '@rollup/rollup-android-arm64': 4.35.0 + '@rollup/rollup-darwin-arm64': 4.35.0 + '@rollup/rollup-darwin-x64': 4.35.0 + '@rollup/rollup-freebsd-arm64': 4.35.0 + '@rollup/rollup-freebsd-x64': 4.35.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.35.0 + '@rollup/rollup-linux-arm-musleabihf': 4.35.0 + '@rollup/rollup-linux-arm64-gnu': 4.35.0 + '@rollup/rollup-linux-arm64-musl': 4.35.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.35.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.35.0 + '@rollup/rollup-linux-riscv64-gnu': 4.35.0 + '@rollup/rollup-linux-s390x-gnu': 4.35.0 + '@rollup/rollup-linux-x64-gnu': 4.35.0 + '@rollup/rollup-linux-x64-musl': 4.35.0 + '@rollup/rollup-win32-arm64-msvc': 4.35.0 + '@rollup/rollup-win32-ia32-msvc': 4.35.0 + '@rollup/rollup-win32-x64-msvc': 4.35.0 fsevents: 2.3.3 run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 - safe-array-concat@1.1.2: + safe-array-concat@1.1.3: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 isarray: 2.0.5 safe-buffer@5.1.2: {} safe-buffer@5.2.1: {} - safe-regex-test@1.0.3: + safe-push-apply@1.0.0: dependencies: - call-bind: 1.0.7 es-errors: 1.3.0 - is-regex: 1.1.4 + isarray: 2.0.5 + + safe-regex-test@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-regex: 1.2.1 safe-stable-stringify@2.5.0: {} @@ -9258,6 +9054,8 @@ snapshots: semver@7.6.3: {} + semver@7.7.1: {} + send@0.19.0: dependencies: debug: 2.6.9 @@ -9290,8 +9088,8 @@ snapshots: define-data-property: 1.1.4 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 + get-intrinsic: 1.3.0 + gopd: 1.2.0 has-property-descriptors: 1.0.2 set-function-name@2.0.2: @@ -9301,6 +9099,12 @@ snapshots: functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 + set-proto@1.0.0: + dependencies: + dunder-proto: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + setprototypeof@1.2.0: {} shebang-command@2.0.0: @@ -9309,12 +9113,33 @@ snapshots: shebang-regex@3.0.0: {} - side-channel@1.0.6: + side-channel-list@1.0.0: dependencies: - call-bind: 1.0.7 es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.2 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 siginfo@2.0.0: {} @@ -9326,7 +9151,7 @@ snapshots: dependencies: '@sigstore/bundle': 2.3.2 '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.2 + '@sigstore/protobuf-specs': 0.3.3 '@sigstore/sign': 2.3.2 '@sigstore/tuf': 2.3.4 '@sigstore/verify': 1.2.1 @@ -9354,15 +9179,15 @@ snapshots: smart-buffer@4.2.0: {} - socks-proxy-agent@8.0.4: + socks-proxy-agent@8.0.5: dependencies: - agent-base: 7.1.1 + agent-base: 7.1.3 debug: 4.4.0 - socks: 2.8.3 + socks: 2.8.4 transitivePeerDependencies: - supports-color - socks@2.8.3: + socks@2.8.4: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 @@ -9379,16 +9204,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.20 + spdx-license-ids: 3.0.21 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.20 + spdx-license-ids: 3.0.21 - spdx-license-ids@3.0.20: {} + spdx-license-ids@3.0.21: {} sprintf-js@1.1.3: {} @@ -9406,15 +9231,14 @@ snapshots: statuses@2.0.1: {} - std-env@3.7.0: {} - - std-env@3.8.0: {} + std-env@3.8.1: {} stdin-discarder@0.2.2: {} - stop-iteration-iterator@1.0.0: + stop-iteration-iterator@1.1.0: dependencies: - internal-slot: 1.0.7 + es-errors: 1.3.0 + internal-slot: 1.1.0 stoppable@1.1.0: {} @@ -9435,29 +9259,33 @@ snapshots: string-width@7.2.0: dependencies: emoji-regex: 10.4.0 - get-east-asian-width: 1.2.0 + get-east-asian-width: 1.3.0 strip-ansi: 7.1.0 string.prototype.repeat@0.2.0: {} - string.prototype.trim@1.2.9: + string.prototype.trim@1.2.10: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + define-data-property: 1.1.4 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 + has-property-descriptors: 1.0.2 - string.prototype.trimend@1.0.8: + string.prototype.trimend@1.0.9: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 string.prototype.trimstart@1.0.8: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 string_decoder@1.1.1: dependencies: @@ -9485,7 +9313,7 @@ snapshots: strip-json-comments@3.1.1: {} - strnum@1.0.5: {} + strnum@2.0.5: {} supports-color@7.2.0: dependencies: @@ -9493,24 +9321,24 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - syncpack@13.0.0(typescript@5.6.2): + syncpack@13.0.3(typescript@5.6.3): dependencies: - '@effect/schema': 0.71.1(effect@3.6.5) - chalk: 5.3.0 + '@effect/schema': 0.75.5(effect@3.13.11) + chalk: 5.4.1 chalk-template: 1.1.0 - commander: 12.1.0 - cosmiconfig: 9.0.0(typescript@5.6.2) - effect: 3.6.5 + commander: 13.1.0 + cosmiconfig: 9.0.0(typescript@5.6.3) + effect: 3.13.11 enquirer: 2.4.1 - fast-check: 3.21.0 - globby: 14.0.2 + fast-check: 3.23.2 + globby: 14.1.0 jsonc-parser: 3.3.1 minimatch: 9.0.5 - npm-package-arg: 11.0.3 - ora: 8.0.1 + npm-package-arg: 12.0.2 + ora: 8.2.0 prompts: 2.4.2 read-yaml-file: 2.1.0 - semver: 7.6.3 + semver: 7.7.1 tightrope: 0.2.0 ts-toolbelt: 9.6.0 transitivePeerDependencies: @@ -9548,8 +9376,6 @@ snapshots: text-hex@1.0.0: {} - text-table@0.2.0: {} - tightrope@0.2.0: {} tinybench@2.9.0: {} @@ -9570,6 +9396,8 @@ snapshots: dependencies: is-number: 7.0.0 + toad-cache@3.7.0: {} + toidentifier@1.0.1: {} tr46@0.0.3: {} @@ -9578,9 +9406,9 @@ snapshots: triple-beam@1.4.1: {} - ts-api-utils@1.3.0(typescript@5.6.2): + ts-api-utils@2.0.1(typescript@5.6.3): dependencies: - typescript: 5.6.2 + typescript: 5.6.3 ts-api-utils@2.0.1(typescript@5.7.3): dependencies: @@ -9595,12 +9423,12 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 - tslib@2.7.0: {} + tslib@2.8.1: {} - tsx@4.19.2: + tsx@4.19.3: dependencies: - esbuild: 0.23.1 - get-tsconfig: 4.8.1 + esbuild: 0.25.1 + get-tsconfig: 4.10.0 optionalDependencies: fsevents: 2.3.3 @@ -9639,37 +9467,38 @@ snapshots: media-typer: 0.3.0 mime-types: 2.1.35 - typed-array-buffer@1.0.2: + typed-array-buffer@1.0.3: dependencies: - call-bind: 1.0.7 + call-bound: 1.0.4 es-errors: 1.3.0 - is-typed-array: 1.1.13 + is-typed-array: 1.1.15 - typed-array-byte-length@1.0.1: + typed-array-byte-length@1.0.3: dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 - typed-array-byte-offset@1.0.2: + typed-array-byte-offset@1.0.4: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - - typed-array-length@1.0.6: - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.10 + + typed-array-length@1.0.7: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.5 + gopd: 1.2.0 + is-typed-array: 1.1.15 + possible-typed-array-names: 1.1.0 + reflect.getprototypeof: 1.0.10 typedarray-to-buffer@3.1.5: dependencies: @@ -9677,39 +9506,38 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@8.24.0(eslint@9.11.1)(typescript@5.7.3): + typescript-eslint@8.26.1(eslint@9.22.0)(typescript@5.6.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/parser': 8.24.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.11.1)(typescript@5.7.3) - eslint: 9.11.1 - typescript: 5.7.3 + '@typescript-eslint/eslint-plugin': 8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.6.3) + eslint: 9.22.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - typescript-eslint@8.7.0(eslint@9.11.1)(typescript@5.6.2): + typescript-eslint@8.26.1(eslint@9.22.0)(typescript@5.7.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1)(typescript@5.6.2))(eslint@9.11.1)(typescript@5.6.2) - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + '@typescript-eslint/eslint-plugin': 8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.7.3) + '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.7.3) + '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) + eslint: 9.22.0 + typescript: 5.7.3 transitivePeerDependencies: - - eslint - supports-color typescript@5.1.6: {} - typescript@5.6.2: {} + typescript@5.6.3: {} typescript@5.7.3: {} - unbox-primitive@1.0.2: + unbox-primitive@1.1.0: dependencies: - call-bind: 1.0.7 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 + call-bound: 1.0.4 + has-bigints: 1.1.0 + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.1 underscore@1.13.7: {} @@ -9717,12 +9545,14 @@ snapshots: undici-types@6.20.0: {} - undici@5.28.4: + undici@5.28.5: dependencies: '@fastify/busboy': 2.1.1 unicorn-magic@0.1.0: {} + unicorn-magic@0.3.0: {} + unique-filename@3.0.0: dependencies: unique-slug: 4.0.0 @@ -9753,9 +9583,9 @@ snapshots: unpipe@1.0.0: {} - update-browserslist-db@1.1.0(browserslist@4.24.0): + update-browserslist-db@1.1.3(browserslist@4.24.4): dependencies: - browserslist: 4.24.0 + browserslist: 4.24.4 escalade: 3.2.0 picocolors: 1.1.1 @@ -9786,15 +9616,16 @@ snapshots: vary@1.1.2: {} - vite-node@3.0.5(@types/node@22.5.5): + vite-node@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.3 - vite: 5.4.14(@types/node@22.5.5) + vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@types/node' + - jiti - less - lightningcss - sass @@ -9803,41 +9634,46 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml - vite@5.4.14(@types/node@22.5.5): + vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: - esbuild: 0.21.5 - postcss: 8.5.1 - rollup: 4.34.4 + esbuild: 0.25.1 + postcss: 8.5.3 + rollup: 4.35.0 optionalDependencies: '@types/node': 22.5.5 fsevents: 2.3.3 + tsx: 4.19.3 + yaml: 2.7.0 - vitest@3.0.5(@types/node@22.5.5): + vitest@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: - '@vitest/expect': 3.0.5 - '@vitest/mocker': 3.0.5(vite@5.4.14(@types/node@22.5.5)) - '@vitest/pretty-format': 3.0.5 - '@vitest/runner': 3.0.5 - '@vitest/snapshot': 3.0.5 - '@vitest/spy': 3.0.5 - '@vitest/utils': 3.0.5 - chai: 5.1.2 + '@vitest/expect': 3.0.8 + '@vitest/mocker': 3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0)) + '@vitest/pretty-format': 3.0.8 + '@vitest/runner': 3.0.8 + '@vitest/snapshot': 3.0.8 + '@vitest/spy': 3.0.8 + '@vitest/utils': 3.0.8 + chai: 5.2.0 debug: 4.4.0 - expect-type: 1.1.0 + expect-type: 1.2.0 magic-string: 0.30.17 pathe: 2.0.3 - std-env: 3.8.0 + std-env: 3.8.1 tinybench: 2.9.0 tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 5.4.14(@types/node@22.5.5) - vite-node: 3.0.5(@types/node@22.5.5) + vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) + vite-node: 3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.5.5 transitivePeerDependencies: + - jiti - less - lightningcss - msw @@ -9847,6 +9683,8 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml vscode-jsonrpc@8.2.0: {} @@ -9863,7 +9701,7 @@ snapshots: dependencies: vscode-languageserver-protocol: 3.17.5 - vscode-uri@3.0.8: {} + vscode-uri@3.1.0: {} walk-up-path@3.0.1: {} @@ -9876,27 +9714,45 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 - which-boxed-primitive@1.0.2: + which-boxed-primitive@1.1.1: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.2 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + + which-builtin-type@1.2.1: dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 + call-bound: 1.0.4 + function.prototype.name: 1.1.8 + has-tostringtag: 1.0.2 + is-async-function: 2.1.1 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 + is-generator-function: 1.1.0 + is-regex: 1.2.1 + is-weakref: 1.1.1 + isarray: 2.0.5 + which-boxed-primitive: 1.1.1 + which-collection: 1.0.2 + which-typed-array: 1.1.19 which-collection@1.0.2: dependencies: is-map: 2.0.3 is-set: 2.0.3 is-weakmap: 2.0.2 - is-weakset: 2.0.3 + is-weakset: 2.0.4 - which-typed-array@1.1.15: + which-typed-array@1.1.19: dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 + call-bind: 1.0.8 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 has-tostringtag: 1.0.2 which@2.0.2: @@ -9916,32 +9772,12 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 - winston-transport@4.7.1: - dependencies: - logform: 2.7.0 - readable-stream: 3.6.2 - triple-beam: 1.4.1 - winston-transport@4.9.0: dependencies: logform: 2.7.0 readable-stream: 3.6.2 triple-beam: 1.4.1 - winston@3.14.2: - dependencies: - '@colors/colors': 1.6.0 - '@dabh/diagnostics': 2.0.3 - async: 3.2.6 - is-stream: 2.0.1 - logform: 2.6.1 - one-time: 1.0.0 - readable-stream: 3.6.2 - safe-stable-stringify: 2.5.0 - stack-trace: 0.0.10 - triple-beam: 1.4.1 - winston-transport: 4.7.1 - winston@3.17.0: dependencies: '@colors/colors': 1.6.0 @@ -9990,7 +9826,7 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 - ws@8.18.0: {} + ws@8.18.1: {} xdg-basedir@5.1.0: {} @@ -10009,8 +9845,6 @@ snapshots: yallist@5.0.0: {} - yaml@2.5.1: {} - yaml@2.7.0: {} yargs-parser@21.1.1: {} @@ -10027,8 +9861,8 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.1.1: {} + yocto-queue@1.2.0: {} yoctocolors-cjs@2.1.2: {} - zod@3.23.8: {} + zod@3.24.2: {} From 249003199997872bc98c413e264f532b4c03173a Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 18 Mar 2025 05:12:21 +0000 Subject: [PATCH 06/13] udpate --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- pnpm-lock.yaml | 1217 +------------------------ 3 files changed, 20 insertions(+), 1201 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 240c42a996d..9092302b23b 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { "@autorest/system-requirements": "~1.0.2", - "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", + "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz", "fs-extra": "~11.2.0", "tsx": "~4.19.3" }, diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 35d3c2fb959..5793e7dd7cb 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -57,7 +57,7 @@ "@typespec/versioning": ">=0.66.0 <1.0.0" }, "dependencies": { - "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz", + "@typespec/http-client-python": "file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz", "fs-extra": "~11.2.0", "js-yaml": "~4.1.0", "semver": "~7.6.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e169fbc2cbf..35badf8b569 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,22 +57,13 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': -<<<<<<< HEAD - specifier: file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz - version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi) -======= - specifier: ~0.8.0 - version: 0.8.0(okmb572npleddk7eu2wecik6ue) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c + specifier: file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz + version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz(rf26q5ggt4rglvdg4e5l33mtfi) fs-extra: specifier: ~11.2.0 version: 11.2.0 tsx: -<<<<<<< HEAD specifier: ~4.19.3 -======= - specifier: ~4.19.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c version: 4.19.3 devDependencies: '@microsoft.azure/autorest.testserver': @@ -88,13 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': -<<<<<<< HEAD - specifier: file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz - version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(lg66nywn6yumq23sbt2w2cb32e) -======= - specifier: ~0.8.0 - version: 0.8.0(phqovtct7xb2vaqtokn2tbhedm) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c + specifier: file:/workspaces/typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz + version: file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz(lg66nywn6yumq23sbt2w2cb32e) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -105,11 +91,7 @@ importers: specifier: ~7.6.3 version: 7.6.3 tsx: -<<<<<<< HEAD specifier: ~4.19.3 -======= - specifier: ~4.19.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': @@ -176,19 +158,11 @@ importers: specifier: ~5.7.3 version: 5.7.3 typescript-eslint: -<<<<<<< HEAD specifier: ^8.26.1 version: 8.26.1(eslint@9.22.0)(typescript@5.7.3) vitest: specifier: ^3.0.8 version: 3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) -======= - specifier: ^8.21.0 - version: 8.26.0(eslint@9.11.1)(typescript@5.7.3) - vitest: - specifier: ^3.0.5 - version: 3.0.8(@types/node@22.5.5) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c yargs: specifier: ~17.7.2 version: 17.7.2 @@ -323,26 +297,16 @@ packages: resolution: {integrity: sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==} engines: {node: '>=18.0.0'} -<<<<<<< HEAD '@azure/msal-browser@4.7.0': resolution: {integrity: sha512-H4AIPhIQVe1qW4+BJaitqod6UGQiXE3juj7q2ZBsOPjuZicQaqcbnBp2gCroF/icS0+TJ9rGuyCBJbjlAqVOGA==} -======= - '@azure/msal-browser@4.5.1': - resolution: {integrity: sha512-vcva6qA4ytVjg52Ew+RxXGKRuoDMdvNOwT+kECNC36kujYalFQe9B5SNud4WVa/Zk12KFa0bkOHFnjP8cgDv3A==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=0.8.0'} '@azure/msal-common@14.16.0': resolution: {integrity: sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==} engines: {node: '>=0.8.0'} -<<<<<<< HEAD '@azure/msal-common@15.2.1': resolution: {integrity: sha512-eZHtYE5OHDN0o2NahCENkczQ6ffGc0MoUSAI3hpwGpZBHJXaEQMMZPWtIx86da2L9w7uT+Tr/xgJbGwIkvTZTQ==} -======= - '@azure/msal-common@15.2.0': - resolution: {integrity: sha512-HiYfGAKthisUYqHG1nImCf/uzcyS31wng3o+CycWLIM9chnYJ9Lk6jZ30Y6YiYYpTQ9+z/FGUpiKKekd3Arc0A==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=0.8.0'} '@azure/msal-node@2.16.2': @@ -353,10 +317,6 @@ packages: resolution: {integrity: sha512-SriLPKezypIsiZ+TtlFfE46uuBIap2HeaQVS78e1P7rz5OSbq0rsd52WE1mC5f7vAeLiXqv7I7oRhL3WFZEw3Q==} engines: {node: '>=18.0.0'} - '@babel/code-frame@7.24.7': - resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} @@ -365,10 +325,6 @@ packages: resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.7': - resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} - engines: {node: '>=6.9.0'} - '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} @@ -518,13 +474,8 @@ packages: '@cspell/dict-node@4.0.3': resolution: {integrity: sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==} -<<<<<<< HEAD '@cspell/dict-npm@5.1.30': resolution: {integrity: sha512-qRMJZFz4FBPECH5rGQN9p2Ld6nfpSaPFQvlG6V2RowWcrJQqF4RFmLUNuRQpvndpSeIUo32yX1hxb7AT45ARCQ==} -======= - '@cspell/dict-npm@5.1.29': - resolution: {integrity: sha512-FPCE9MpO42WGc9u/lx3J6CZSfPVO5kMUaOQkTVqXo3sTDX6+o5ulb+9W/MD33kiA0AvXr1Lk8knhA6koW9t/Yw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@cspell/dict-php@4.0.14': resolution: {integrity: sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==} @@ -535,13 +486,8 @@ packages: '@cspell/dict-public-licenses@2.0.13': resolution: {integrity: sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==} -<<<<<<< HEAD '@cspell/dict-python@4.2.16': resolution: {integrity: sha512-LkQssFt1hPOWXIQiD8ScTkz/41RL7Ti0V/2ytUzEW82dc0atIEksrBg8MuOjWXktp0Dk5tDwRLgmIvhV3CFFOA==} -======= - '@cspell/dict-python@4.2.15': - resolution: {integrity: sha512-VNXhj0Eh+hdHN89MgyaoSAexBQKmYtJaMhucbMI7XmBs4pf8fuFFN3xugk51/A4TZJr8+RImdFFsGMOw+I4bDA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@cspell/dict-r@2.1.0': resolution: {integrity: sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==} @@ -593,296 +539,108 @@ packages: peerDependencies: effect: ^3.9.2 -<<<<<<< HEAD '@esbuild/aix-ppc64@0.25.1': resolution: {integrity: sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==} -======= - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - - '@esbuild/aix-ppc64@0.25.0': - resolution: {integrity: sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [ppc64] os: [aix] -<<<<<<< HEAD '@esbuild/android-arm64@0.25.1': resolution: {integrity: sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==} -======= - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm64@0.25.0': - resolution: {integrity: sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [android] -<<<<<<< HEAD '@esbuild/android-arm@0.25.1': resolution: {integrity: sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==} -======= - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - - '@esbuild/android-arm@0.25.0': - resolution: {integrity: sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm] os: [android] -<<<<<<< HEAD '@esbuild/android-x64@0.25.1': resolution: {integrity: sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==} -======= - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - - '@esbuild/android-x64@0.25.0': - resolution: {integrity: sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [android] -<<<<<<< HEAD '@esbuild/darwin-arm64@0.25.1': resolution: {integrity: sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==} -======= - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-arm64@0.25.0': - resolution: {integrity: sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [darwin] -<<<<<<< HEAD '@esbuild/darwin-x64@0.25.1': resolution: {integrity: sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==} -======= - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - - '@esbuild/darwin-x64@0.25.0': - resolution: {integrity: sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [darwin] -<<<<<<< HEAD '@esbuild/freebsd-arm64@0.25.1': resolution: {integrity: sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==} -======= - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-arm64@0.25.0': - resolution: {integrity: sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [freebsd] -<<<<<<< HEAD '@esbuild/freebsd-x64@0.25.1': resolution: {integrity: sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==} -======= - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.25.0': - resolution: {integrity: sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [freebsd] -<<<<<<< HEAD '@esbuild/linux-arm64@0.25.1': resolution: {integrity: sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==} -======= - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm64@0.25.0': - resolution: {integrity: sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [linux] -<<<<<<< HEAD '@esbuild/linux-arm@0.25.1': resolution: {integrity: sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==} -======= - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-arm@0.25.0': - resolution: {integrity: sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm] os: [linux] -<<<<<<< HEAD '@esbuild/linux-ia32@0.25.1': resolution: {integrity: sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==} -======= - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-ia32@0.25.0': - resolution: {integrity: sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [ia32] os: [linux] -<<<<<<< HEAD '@esbuild/linux-loong64@0.25.1': resolution: {integrity: sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==} -======= - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-loong64@0.25.0': - resolution: {integrity: sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [loong64] os: [linux] -<<<<<<< HEAD '@esbuild/linux-mips64el@0.25.1': resolution: {integrity: sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==} -======= - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-mips64el@0.25.0': - resolution: {integrity: sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [mips64el] os: [linux] -<<<<<<< HEAD '@esbuild/linux-ppc64@0.25.1': resolution: {integrity: sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==} -======= - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-ppc64@0.25.0': - resolution: {integrity: sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [ppc64] os: [linux] -<<<<<<< HEAD '@esbuild/linux-riscv64@0.25.1': resolution: {integrity: sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==} -======= - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-riscv64@0.25.0': - resolution: {integrity: sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [riscv64] os: [linux] -<<<<<<< HEAD '@esbuild/linux-s390x@0.25.1': resolution: {integrity: sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==} -======= - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-s390x@0.25.0': - resolution: {integrity: sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [s390x] os: [linux] -<<<<<<< HEAD '@esbuild/linux-x64@0.25.1': resolution: {integrity: sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==} -======= - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - - '@esbuild/linux-x64@0.25.0': - resolution: {integrity: sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [linux] -<<<<<<< HEAD '@esbuild/netbsd-arm64@0.25.1': resolution: {integrity: sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==} engines: {node: '>=18'} @@ -891,118 +649,42 @@ packages: '@esbuild/netbsd-x64@0.25.1': resolution: {integrity: sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==} -======= - '@esbuild/netbsd-arm64@0.25.0': - resolution: {integrity: sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.25.0': - resolution: {integrity: sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [netbsd] -<<<<<<< HEAD '@esbuild/openbsd-arm64@0.25.1': resolution: {integrity: sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==} -======= - '@esbuild/openbsd-arm64@0.25.0': - resolution: {integrity: sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [openbsd] -<<<<<<< HEAD '@esbuild/openbsd-x64@0.25.1': resolution: {integrity: sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==} -======= - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.25.0': - resolution: {integrity: sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [openbsd] -<<<<<<< HEAD '@esbuild/sunos-x64@0.25.1': resolution: {integrity: sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==} -======= - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - - '@esbuild/sunos-x64@0.25.0': - resolution: {integrity: sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [sunos] -<<<<<<< HEAD '@esbuild/win32-arm64@0.25.1': resolution: {integrity: sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==} -======= - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-arm64@0.25.0': - resolution: {integrity: sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [arm64] os: [win32] -<<<<<<< HEAD '@esbuild/win32-ia32@0.25.1': resolution: {integrity: sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==} -======= - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-ia32@0.25.0': - resolution: {integrity: sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [ia32] os: [win32] -<<<<<<< HEAD '@esbuild/win32-x64@0.25.1': resolution: {integrity: sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==} -======= - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - - '@esbuild/win32-x64@0.25.0': - resolution: {integrity: sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -1490,7 +1172,6 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} -<<<<<<< HEAD '@rollup/rollup-android-arm-eabi@4.35.0': resolution: {integrity: sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==} cpu: [arm] @@ -1583,85 +1264,6 @@ packages: '@rollup/rollup-win32-x64-msvc@4.35.0': resolution: {integrity: sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==} -======= - '@rollup/rollup-android-arm-eabi@4.22.4': - resolution: {integrity: sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==} - cpu: [arm] - os: [android] - - '@rollup/rollup-android-arm64@4.22.4': - resolution: {integrity: sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==} - cpu: [arm64] - os: [android] - - '@rollup/rollup-darwin-arm64@4.22.4': - resolution: {integrity: sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==} - cpu: [arm64] - os: [darwin] - - '@rollup/rollup-darwin-x64@4.22.4': - resolution: {integrity: sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==} - cpu: [x64] - os: [darwin] - - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': - resolution: {integrity: sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==} - cpu: [arm] - os: [linux] - - '@rollup/rollup-linux-arm-musleabihf@4.22.4': - resolution: {integrity: sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==} - cpu: [arm] - os: [linux] - - '@rollup/rollup-linux-arm64-gnu@4.22.4': - resolution: {integrity: sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==} - cpu: [arm64] - os: [linux] - - '@rollup/rollup-linux-arm64-musl@4.22.4': - resolution: {integrity: sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==} - cpu: [arm64] - os: [linux] - - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': - resolution: {integrity: sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==} - cpu: [ppc64] - os: [linux] - - '@rollup/rollup-linux-riscv64-gnu@4.22.4': - resolution: {integrity: sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==} - cpu: [riscv64] - os: [linux] - - '@rollup/rollup-linux-s390x-gnu@4.22.4': - resolution: {integrity: sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==} - cpu: [s390x] - os: [linux] - - '@rollup/rollup-linux-x64-gnu@4.22.4': - resolution: {integrity: sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==} - cpu: [x64] - os: [linux] - - '@rollup/rollup-linux-x64-musl@4.22.4': - resolution: {integrity: sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==} - cpu: [x64] - os: [linux] - - '@rollup/rollup-win32-arm64-msvc@4.22.4': - resolution: {integrity: sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==} - cpu: [arm64] - os: [win32] - - '@rollup/rollup-win32-ia32-msvc@4.22.4': - resolution: {integrity: sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==} - cpu: [ia32] - os: [win32] - - '@rollup/rollup-win32-x64-msvc@4.22.4': - resolution: {integrity: sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c cpu: [x64] os: [win32] @@ -1738,9 +1340,6 @@ packages: '@types/aws-lambda@8.10.147': resolution: {integrity: sha512-nD0Z9fNIZcxYX5Mai2CTmFD7wX7UldCkW2ezCF8D1T5hdiLsnTWDGRpfRYntU6VjTdLQjOvyszru7I1c1oCQew==} - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -1783,37 +1382,16 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} -<<<<<<< HEAD '@typescript-eslint/eslint-plugin@8.26.1': resolution: {integrity: sha512-2X3mwqsj9Bd3Ciz508ZUtoQQYpOhU/kWoUqIf49H8Z0+Vbh6UF/y0OEYp0Q0axOGzaBGs7QxRwq0knSQ8khQNA==} -======= - '@typescript-eslint/eslint-plugin@8.26.0': - resolution: {integrity: sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' -<<<<<<< HEAD '@typescript-eslint/parser@8.26.1': resolution: {integrity: sha512-w6HZUV4NWxqd8BdeFf81t07d7/YV9s7TCWrQQbG5uhuvGUAW+fq1usZ1Hmz9UPNLniFnD8GLSsDpjP0hm1S4lQ==} -======= - '@typescript-eslint/eslint-plugin@8.7.0': - resolution: {integrity: sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 - eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/parser@8.26.0': - resolution: {integrity: sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1830,13 +1408,8 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' -<<<<<<< HEAD '@typescript-eslint/types@8.26.1': resolution: {integrity: sha512-n4THUQW27VmQMx+3P+B0Yptl7ydfceUj4ON/AQILAASwgYdZ/2dhfymRMh5egRUrvK5lSmaOm77Ry+lmXPOgBQ==} -======= - '@typescript-eslint/scope-manager@8.26.0': - resolution: {integrity: sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@8.26.1': @@ -1845,74 +1418,15 @@ packages: peerDependencies: typescript: '>=4.8.4 <5.9.0' -<<<<<<< HEAD '@typescript-eslint/utils@8.26.1': resolution: {integrity: sha512-V4Urxa/XtSUroUrnI7q6yUTD3hDtfJ2jzVfeT3VK0ciizfK2q/zGC0iDh1lFMUZR8cImRrep6/q0xd/1ZGPQpg==} -======= - '@typescript-eslint/type-utils@8.26.0': - resolution: {integrity: sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' -<<<<<<< HEAD '@typescript-eslint/visitor-keys@8.26.1': resolution: {integrity: sha512-AjOC3zfnxd6S4Eiy3jwktJPclqhFHNyd8L6Gycf9WUPoKZpgM5PjkxY1X7uSy61xVpiJDhhk7XT2NVsN3ALTWg==} -======= - '@typescript-eslint/type-utils@8.7.0': - resolution: {integrity: sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/types@8.26.0': - resolution: {integrity: sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/types@8.7.0': - resolution: {integrity: sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.26.0': - resolution: {integrity: sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <5.9.0' - - '@typescript-eslint/typescript-estree@8.7.0': - resolution: {integrity: sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - '@typescript-eslint/utils@8.26.0': - resolution: {integrity: sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' - - '@typescript-eslint/utils@8.7.0': - resolution: {integrity: sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - - '@typescript-eslint/visitor-keys@8.26.0': - resolution: {integrity: sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/visitor-keys@8.7.0': - resolution: {integrity: sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typespec/compiler@0.66.0': @@ -1920,20 +1434,15 @@ packages: engines: {node: '>=18.0.0'} hasBin: true -<<<<<<< HEAD '@typespec/events@0.66.0': resolution: {integrity: sha512-I0FlzJhLxhxPKzp+qfjQECIoKQJwuS/GpR9SaArYsroyL6YUZmwpyDHHbYDQ7/VHU/sRFJGvgVfDPhpooghlqA==} engines: {node: '>=18.0.0'} peerDependencies: '@typespec/compiler': ~0.66.0 - '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz': - resolution: {integrity: sha512-jxR5ftR6qMEQdTaIAdTmPhX85XjNiqZt8l5uVxwv9UjIK2T0hzEawWeHYUYJ92fmYmtBNpIOtmbRQLMp+2vnDQ==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz} - version: 0.7.1 -======= - '@typespec/http-client-python@0.8.0': - resolution: {integrity: sha512-JjbOyXall3aqdy5QtCDwRcExZ9IOdlwntdzmbR70PdTVLIyg8XqgSwx3B/A57/H7UbBkvvwVEVfVMvpiodlv/A==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz': + resolution: {integrity: sha512-1nU1QHjbrzDLuIU5sAJzYe3Lty18MS2HM1nkoeoGUglxSKVIY3yUx79H6muycPUuJJwo2SYY+xEzDLsnqNwqWg==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz} + version: 0.8.0 engines: {node: '>=18.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.52.0 <1.0.0' @@ -2102,10 +1611,6 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -2173,13 +1678,8 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} -<<<<<<< HEAD axios@1.8.3: resolution: {integrity: sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==} -======= - axios@1.8.1: - resolution: {integrity: sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -2287,10 +1787,6 @@ packages: resolution: {integrity: sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==} engines: {node: '>=14.16'} - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -2686,13 +2182,8 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} -<<<<<<< HEAD esbuild@0.25.1: resolution: {integrity: sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==} -======= - esbuild@0.25.0: - resolution: {integrity: sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18'} hasBin: true @@ -2995,20 +2486,12 @@ packages: resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} engines: {node: '>=18'} -<<<<<<< HEAD get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} get-proto@1.0.1: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} -======= - get-func-name@2.0.2: - resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>= 0.4'} get-stdin@9.0.0: @@ -3086,10 +2569,6 @@ packages: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} engines: {node: '>= 0.4'} - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -3549,9 +3028,6 @@ packages: resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} engines: {node: '>= 12.0.0'} - loupe@3.1.1: - resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} - loupe@3.1.3: resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} @@ -3727,13 +3203,8 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} -<<<<<<< HEAD nanoid@3.3.10: resolution: {integrity: sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==} -======= - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -4075,13 +3546,8 @@ packages: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} -<<<<<<< HEAD postcss@8.5.3: resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} -======= - postcss@8.4.47: - resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -4265,13 +3731,8 @@ packages: engines: {node: 20 || >=22} hasBin: true -<<<<<<< HEAD rollup@4.35.0: resolution: {integrity: sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==} -======= - rollup@4.22.4: - resolution: {integrity: sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -4455,12 +3916,6 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} -<<<<<<< HEAD -======= - std-env@3.7.0: - resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} - ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c std-env@3.8.1: resolution: {integrity: sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==} @@ -4540,10 +3995,6 @@ packages: strnum@2.0.5: resolution: {integrity: sha512-YAT3K/sgpCUxhxNMrrdhtod3jckkpYwH6JAuwmUdXZsmzH1wUyzTMrrK2wYCEEqlKwrWDd35NeuUkbBy/1iK+Q==} - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -4705,29 +4156,12 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} -<<<<<<< HEAD typescript-eslint@8.26.1: resolution: {integrity: sha512-t/oIs9mYyrwZGRpDv3g+3K6nZ5uhKEMt2oNmAPwaY4/ye0+EH4nXIPYNtkYFS6QHm+1DFg34DbglYBz5P9Xysg==} -======= - typescript-eslint@8.26.0: - resolution: {integrity: sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' -<<<<<<< HEAD -======= - - typescript-eslint@8.7.0: - resolution: {integrity: sha512-nEHbEYJyHwsuf7c3V3RS7Saq+1+la3i0ieR3qP0yjqWSzVmh8Drp47uOl9LjbPANac4S7EFSqvcYIKXUUwIfIQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} @@ -4850,15 +4284,9 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true -<<<<<<< HEAD vite@6.2.2: resolution: {integrity: sha512-yW7PeMM+LkDzc7CgJuRLMW2Jz0FxMOsVJ8Lv3gpgW9WLcb9cTW+121UEr1hvmfR7w3SegR5ItvYyzVz1vxNJgQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} -======= - vite@5.4.8: - resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==} - engines: {node: ^18.0.0 || >=20.0.0} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c hasBin: true peerDependencies: '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 @@ -5111,7 +4539,7 @@ snapshots: '@autorest/python@file:packages/autorest.python(rf26q5ggt4rglvdg4e5l33mtfi)': dependencies: '@autorest/system-requirements': 1.0.2 - '@typespec/http-client-python': file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi) + '@typespec/http-client-python': file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz(rf26q5ggt4rglvdg4e5l33mtfi) fs-extra: 11.2.0 tsx: 4.19.3 transitivePeerDependencies: @@ -5255,17 +4683,7 @@ snapshots: '@azure/abort-controller@2.1.2': dependencies: -<<<<<<< HEAD tslib: 2.8.1 -======= - tslib: 2.7.0 - - '@azure/core-auth@1.8.0': - dependencies: - '@azure/abort-controller': 2.1.2 - '@azure/core-util': 1.10.0 - tslib: 2.7.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/core-auth@1.9.0': dependencies: @@ -5276,17 +4694,10 @@ snapshots: '@azure/core-client@1.9.3': dependencies: '@azure/abort-controller': 2.1.2 -<<<<<<< HEAD '@azure/core-auth': 1.9.0 '@azure/core-rest-pipeline': 1.19.1 '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 -======= - '@azure/core-auth': 1.8.0 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 - '@azure/core-util': 1.10.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/logger': 1.1.4 tslib: 2.8.1 transitivePeerDependencies: @@ -5303,7 +4714,7 @@ snapshots: '@azure/core-lro@2.7.2': dependencies: '@azure/abort-controller': 2.1.2 - '@azure/core-util': 1.10.0 + '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 tslib: 2.8.1 @@ -5314,15 +4725,9 @@ snapshots: '@azure/core-rest-pipeline@1.19.1': dependencies: '@azure/abort-controller': 2.1.2 -<<<<<<< HEAD '@azure/core-auth': 1.9.0 '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 -======= - '@azure/core-auth': 1.8.0 - '@azure/core-tracing': 1.1.2 - '@azure/core-util': 1.10.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/logger': 1.1.4 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 @@ -5353,11 +4758,7 @@ snapshots: '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 '@azure/logger': 1.1.4 -<<<<<<< HEAD '@azure/msal-browser': 4.7.0 -======= - '@azure/msal-browser': 4.5.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/msal-node': 2.16.2 events: 3.3.0 jws: 4.0.0 @@ -5371,7 +4772,6 @@ snapshots: dependencies: tslib: 2.8.1 -<<<<<<< HEAD '@azure/msal-browser@4.7.0': dependencies: '@azure/msal-common': 15.2.1 @@ -5379,15 +4779,6 @@ snapshots: '@azure/msal-common@14.16.0': {} '@azure/msal-common@15.2.1': {} -======= - '@azure/msal-browser@4.5.1': - dependencies: - '@azure/msal-common': 15.2.0 - - '@azure/msal-common@14.16.0': {} - - '@azure/msal-common@15.2.0': {} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/msal-node@2.16.2': dependencies: @@ -5398,7 +4789,6 @@ snapshots: '@azure/storage-blob@12.26.0': dependencies: '@azure/abort-controller': 2.1.2 -<<<<<<< HEAD '@azure/core-auth': 1.9.0 '@azure/core-client': 1.9.3 '@azure/core-http-compat': 2.2.0 @@ -5408,28 +4798,12 @@ snapshots: '@azure/core-tracing': 1.2.0 '@azure/core-util': 1.11.0 '@azure/core-xml': 1.4.5 -======= - '@azure/core-auth': 1.8.0 - '@azure/core-client': 1.9.2 - '@azure/core-http-compat': 2.1.2 - '@azure/core-lro': 2.7.2 - '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.17.0 - '@azure/core-tracing': 1.1.2 - '@azure/core-util': 1.10.0 - '@azure/core-xml': 1.4.3 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@azure/logger': 1.1.4 events: 3.3.0 tslib: 2.8.1 transitivePeerDependencies: - supports-color - '@babel/code-frame@7.24.7': - dependencies: - '@babel/highlight': 7.24.7 - picocolors: 1.1.0 - '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 @@ -5438,13 +4812,6 @@ snapshots: '@babel/helper-validator-identifier@7.25.9': {} - '@babel/highlight@7.24.7': - dependencies: - '@babel/helper-validator-identifier': 7.24.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.1.0 - '@bcoe/v8-coverage@1.0.2': {} '@chronus/chronus@0.12.1': @@ -5454,18 +4821,13 @@ snapshots: is-unicode-supported: 2.1.0 micromatch: 4.0.8 pacote: 18.0.6 - picocolors: 1.1.0 + picocolors: 1.1.1 pluralize: 8.0.0 prompts: 2.4.2 semver: 7.7.1 source-map-support: 0.5.21 -<<<<<<< HEAD std-env: 3.8.1 yaml: 2.7.0 -======= - std-env: 3.7.0 - yaml: 2.5.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c yargs: 17.7.2 zod: 3.24.2 transitivePeerDependencies: @@ -5540,19 +4902,11 @@ snapshots: '@cspell/dict-lua': 4.0.7 '@cspell/dict-makefile': 1.0.4 '@cspell/dict-node': 4.0.3 -<<<<<<< HEAD '@cspell/dict-npm': 5.1.30 '@cspell/dict-php': 4.0.14 '@cspell/dict-powershell': 5.0.14 '@cspell/dict-public-licenses': 2.0.13 '@cspell/dict-python': 4.2.16 -======= - '@cspell/dict-npm': 5.1.29 - '@cspell/dict-php': 4.0.14 - '@cspell/dict-powershell': 5.0.14 - '@cspell/dict-public-licenses': 2.0.13 - '@cspell/dict-python': 4.2.15 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@cspell/dict-r': 2.1.0 '@cspell/dict-ruby': 5.0.8 '@cspell/dict-rust': 4.0.11 @@ -5648,11 +5002,7 @@ snapshots: '@cspell/dict-node@4.0.3': {} -<<<<<<< HEAD '@cspell/dict-npm@5.1.30': {} -======= - '@cspell/dict-npm@5.1.29': {} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@cspell/dict-php@4.0.14': {} @@ -5660,11 +5010,7 @@ snapshots: '@cspell/dict-public-licenses@2.0.13': {} -<<<<<<< HEAD '@cspell/dict-python@4.2.16': -======= - '@cspell/dict-python@4.2.15': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: '@cspell/dict-data-science': 2.0.7 @@ -5710,200 +5056,79 @@ snapshots: '@esbuild/aix-ppc64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/android-arm64@0.25.1': -======= - '@esbuild/aix-ppc64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/android-arm@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/android-x64@0.25.1': -======= - '@esbuild/android-arm64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/darwin-arm64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/darwin-x64@0.25.1': -======= - '@esbuild/android-arm@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/freebsd-arm64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/freebsd-x64@0.25.1': -======= - '@esbuild/android-x64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/linux-arm64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/linux-arm@0.25.1': -======= - '@esbuild/darwin-arm64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/linux-ia32@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/linux-loong64@0.25.1': -======= - '@esbuild/darwin-x64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/linux-mips64el@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/linux-ppc64@0.25.1': -======= - '@esbuild/freebsd-arm64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/linux-riscv64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/linux-s390x@0.25.1': -======= - '@esbuild/freebsd-x64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/linux-x64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/netbsd-arm64@0.25.1': -======= - '@esbuild/linux-arm64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/netbsd-x64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/openbsd-arm64@0.25.1': -======= - '@esbuild/linux-arm@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/openbsd-x64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/sunos-x64@0.25.1': -======= - '@esbuild/linux-ia32@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/win32-arm64@0.25.1': optional: true -<<<<<<< HEAD '@esbuild/win32-ia32@0.25.1': -======= - '@esbuild/linux-loong64@0.25.0': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@esbuild/win32-x64@0.25.1': optional: true -<<<<<<< HEAD '@eslint-community/eslint-utils@4.5.1(eslint@9.22.0)': -======= - '@esbuild/linux-mips64el@0.25.0': - optional: true - - '@esbuild/linux-ppc64@0.21.5': - optional: true - - '@esbuild/linux-ppc64@0.25.0': - optional: true - - '@esbuild/linux-riscv64@0.21.5': - optional: true - - '@esbuild/linux-riscv64@0.25.0': - optional: true - - '@esbuild/linux-s390x@0.21.5': - optional: true - - '@esbuild/linux-s390x@0.25.0': - optional: true - - '@esbuild/linux-x64@0.21.5': - optional: true - - '@esbuild/linux-x64@0.25.0': - optional: true - - '@esbuild/netbsd-arm64@0.25.0': - optional: true - - '@esbuild/netbsd-x64@0.21.5': - optional: true - - '@esbuild/netbsd-x64@0.25.0': - optional: true - - '@esbuild/openbsd-arm64@0.25.0': - optional: true - - '@esbuild/openbsd-x64@0.21.5': - optional: true - - '@esbuild/openbsd-x64@0.25.0': - optional: true - - '@esbuild/sunos-x64@0.21.5': - optional: true - - '@esbuild/sunos-x64@0.25.0': - optional: true - - '@esbuild/win32-arm64@0.21.5': - optional: true - - '@esbuild/win32-arm64@0.25.0': - optional: true - - '@esbuild/win32-ia32@0.21.5': - optional: true - - '@esbuild/win32-ia32@0.25.0': - optional: true - - '@esbuild/win32-x64@0.21.5': - optional: true - - '@esbuild/win32-x64@0.25.0': - optional: true - - '@eslint-community/eslint-utils@4.4.0(eslint@9.11.1)': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: eslint: 9.22.0 eslint-visitor-keys: 3.4.3 @@ -5912,13 +5137,8 @@ snapshots: '@eslint/config-array@0.19.2': dependencies: -<<<<<<< HEAD '@eslint/object-schema': 2.1.6 debug: 4.4.0 -======= - '@eslint/object-schema': 2.1.4 - debug: 4.3.7 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -5932,13 +5152,8 @@ snapshots: '@eslint/eslintrc@3.3.0': dependencies: ajv: 6.12.6 -<<<<<<< HEAD debug: 4.4.0 espree: 10.3.0 -======= - debug: 4.3.7 - espree: 10.1.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.1 @@ -6675,7 +5890,6 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true -<<<<<<< HEAD '@rollup/rollup-android-arm-eabi@4.35.0': optional: true @@ -6731,54 +5945,6 @@ snapshots: optional: true '@rollup/rollup-win32-x64-msvc@4.35.0': -======= - '@rollup/rollup-android-arm-eabi@4.22.4': - optional: true - - '@rollup/rollup-android-arm64@4.22.4': - optional: true - - '@rollup/rollup-darwin-arm64@4.22.4': - optional: true - - '@rollup/rollup-darwin-x64@4.22.4': - optional: true - - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': - optional: true - - '@rollup/rollup-linux-arm-musleabihf@4.22.4': - optional: true - - '@rollup/rollup-linux-arm64-gnu@4.22.4': - optional: true - - '@rollup/rollup-linux-arm64-musl@4.22.4': - optional: true - - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': - optional: true - - '@rollup/rollup-linux-riscv64-gnu@4.22.4': - optional: true - - '@rollup/rollup-linux-s390x-gnu@4.22.4': - optional: true - - '@rollup/rollup-linux-x64-gnu@4.22.4': - optional: true - - '@rollup/rollup-linux-x64-musl@4.22.4': - optional: true - - '@rollup/rollup-win32-arm64-msvc@4.22.4': - optional: true - - '@rollup/rollup-win32-ia32-msvc@4.22.4': - optional: true - - '@rollup/rollup-win32-x64-msvc@4.22.4': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optional: true '@rtsao/scc@1.1.0': {} @@ -6865,8 +6031,6 @@ snapshots: '@types/aws-lambda@8.10.147': {} - '@types/estree@1.0.5': {} - '@types/estree@1.0.6': {} '@types/fs-extra@11.0.4': @@ -6906,7 +6070,6 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 -<<<<<<< HEAD '@typescript-eslint/eslint-plugin@8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -6933,17 +6096,6 @@ snapshots: '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) '@typescript-eslint/visitor-keys': 8.26.1 eslint: 9.22.0 -======= - '@typescript-eslint/eslint-plugin@8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3)': - dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/scope-manager': 8.26.0 - '@typescript-eslint/type-utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.26.0 - eslint: 9.11.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -6964,7 +6116,6 @@ snapshots: transitivePeerDependencies: - supports-color -<<<<<<< HEAD '@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.7.3)': dependencies: '@typescript-eslint/scope-manager': 8.26.1 @@ -6973,23 +6124,12 @@ snapshots: '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 eslint: 9.22.0 -======= - '@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.26.0 - '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.26.0 - debug: 4.3.7 - eslint: 9.11.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c typescript: 5.7.3 transitivePeerDependencies: - supports-color '@typescript-eslint/scope-manager@8.26.1': dependencies: -<<<<<<< HEAD '@typescript-eslint/types': 8.26.1 '@typescript-eslint/visitor-keys': 8.26.1 @@ -7010,35 +6150,6 @@ snapshots: '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) debug: 4.4.0 eslint: 9.22.0 -======= - '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.7.0 - debug: 4.3.7 - eslint: 9.11.1 - optionalDependencies: - typescript: 5.6.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@8.26.0': - dependencies: - '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/visitor-keys': 8.26.0 - - '@typescript-eslint/scope-manager@8.7.0': - dependencies: - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/visitor-keys': 8.7.0 - - '@typescript-eslint/type-utils@8.26.0(eslint@9.11.1)(typescript@5.7.3)': - dependencies: - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - debug: 4.3.7 - eslint: 9.11.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c ts-api-utils: 2.0.1(typescript@5.7.3) typescript: 5.7.3 transitivePeerDependencies: @@ -7048,33 +6159,10 @@ snapshots: '@typescript-eslint/typescript-estree@8.26.1(typescript@5.6.3)': dependencies: -<<<<<<< HEAD '@typescript-eslint/types': 8.26.1 '@typescript-eslint/visitor-keys': 8.26.1 debug: 4.4.0 fast-glob: 3.3.3 -======= - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1)(typescript@5.6.2) - debug: 4.3.7 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 - transitivePeerDependencies: - - eslint - - supports-color - - '@typescript-eslint/types@8.26.0': {} - - '@typescript-eslint/types@8.7.0': {} - - '@typescript-eslint/typescript-estree@8.26.0(typescript@5.7.3)': - dependencies: - '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/visitor-keys': 8.26.0 - debug: 4.3.7 - fast-glob: 3.3.2 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.1 @@ -7099,7 +6187,6 @@ snapshots: '@typescript-eslint/utils@8.26.1(eslint@9.22.0)(typescript@5.6.3)': dependencies: -<<<<<<< HEAD '@eslint-community/eslint-utils': 4.5.1(eslint@9.22.0) '@typescript-eslint/scope-manager': 8.26.1 '@typescript-eslint/types': 8.26.1 @@ -7116,50 +6203,13 @@ snapshots: '@typescript-eslint/types': 8.26.1 '@typescript-eslint/typescript-estree': 8.26.1(typescript@5.7.3) eslint: 9.22.0 -======= - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/visitor-keys': 8.7.0 - debug: 4.3.7 - fast-glob: 3.3.2 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.26.0(eslint@9.11.1)(typescript@5.7.3)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - '@typescript-eslint/scope-manager': 8.26.0 - '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) - eslint: 9.11.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c typescript: 5.7.3 transitivePeerDependencies: - supports-color '@typescript-eslint/visitor-keys@8.26.1': dependencies: -<<<<<<< HEAD '@typescript-eslint/types': 8.26.1 -======= - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) - '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/types': 8.7.0 - '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - eslint: 9.11.1 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/visitor-keys@8.26.0': - dependencies: - '@typescript-eslint/types': 8.26.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c eslint-visitor-keys: 4.2.0 '@typespec/compiler@0.66.0(@types/node@22.10.10)': @@ -7206,36 +6256,15 @@ snapshots: - '@types/node' - supports-color -<<<<<<< HEAD '@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))': -======= - '@typespec/http-client-python@0.8.0(okmb572npleddk7eu2wecik6ue)': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: '@typespec/compiler': 0.66.0(@types/node@22.10.10) -<<<<<<< HEAD '@typespec/events@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))': -======= - '@typespec/http': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - '@typespec/openapi': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/rest': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))) - '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10)) - js-yaml: 4.1.0 - marked: 15.0.7 - pyodide: 0.26.2 - semver: 7.6.3 - tsx: 4.19.3 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@typespec/http-client-python@0.8.0(phqovtct7xb2vaqtokn2tbhedm)': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(lg66nywn6yumq23sbt2w2cb32e)': + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz(lg66nywn6yumq23sbt2w2cb32e)': dependencies: '@azure-tools/typespec-autorest': 0.52.0(pg6owiqeffjzatemiiau7ohgpu) '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5))))) @@ -7256,7 +6285,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.7.1.tgz(rf26q5ggt4rglvdg4e5l33mtfi)': + '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz(rf26q5ggt4rglvdg4e5l33mtfi)': dependencies: '@azure-tools/typespec-autorest': 0.52.0(fdk2ckafnfmhv6wo6zuksvolgu) '@azure-tools/typespec-azure-core': 0.52.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))(@typespec/rest@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/http@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))(@typespec/streams@0.66.0(@typespec/compiler@0.66.0(@types/node@22.10.10))))) @@ -7361,11 +6390,7 @@ snapshots: '@typespec/spec-coverage-sdk': 0.1.0-alpha.3 '@typespec/versioning': 0.66.0(@typespec/compiler@0.66.0(@types/node@22.5.5)) ajv: 8.17.1 -<<<<<<< HEAD axios: 1.8.3 -======= - axios: 1.8.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c body-parser: 1.20.3 deep-equal: 2.2.3 express: 4.21.2 @@ -7434,21 +6459,13 @@ snapshots: chai: 5.2.0 tinyrainbow: 2.0.0 -<<<<<<< HEAD '@vitest/mocker@3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0))': -======= - '@vitest/mocker@3.0.8(vite@5.4.8(@types/node@22.5.5))': ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: '@vitest/spy': 3.0.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: -<<<<<<< HEAD vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) -======= - vite: 5.4.8(@types/node@22.5.5) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@vitest/pretty-format@3.0.8': dependencies: @@ -7490,15 +6507,7 @@ snapshots: acorn@8.14.1: {} -<<<<<<< HEAD agent-base@7.1.3: {} -======= - agent-base@7.1.1: - dependencies: - debug: 4.3.7 - transitivePeerDependencies: - - supports-color ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c aggregate-error@3.1.0: dependencies: @@ -7529,10 +6538,6 @@ snapshots: ansi-regex@6.1.0: {} - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -7609,11 +6614,7 @@ snapshots: dependencies: possible-typed-array-names: 1.1.0 -<<<<<<< HEAD axios@1.8.3: -======= - axios@1.8.1: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: follow-redirects: 1.15.9 form-data: 4.0.2 @@ -7762,19 +6763,13 @@ snapshots: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.1 + loupe: 3.1.3 pathval: 2.0.0 chalk-template@1.1.0: dependencies: chalk: 5.4.1 - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -8264,7 +7259,6 @@ snapshots: esbuild@0.25.1: optionalDependencies: -<<<<<<< HEAD '@esbuild/aix-ppc64': 0.25.1 '@esbuild/android-arm': 0.25.1 '@esbuild/android-arm64': 0.25.1 @@ -8290,59 +7284,6 @@ snapshots: '@esbuild/win32-arm64': 0.25.1 '@esbuild/win32-ia32': 0.25.1 '@esbuild/win32-x64': 0.25.1 -======= - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 - - esbuild@0.25.0: - optionalDependencies: - '@esbuild/aix-ppc64': 0.25.0 - '@esbuild/android-arm': 0.25.0 - '@esbuild/android-arm64': 0.25.0 - '@esbuild/android-x64': 0.25.0 - '@esbuild/darwin-arm64': 0.25.0 - '@esbuild/darwin-x64': 0.25.0 - '@esbuild/freebsd-arm64': 0.25.0 - '@esbuild/freebsd-x64': 0.25.0 - '@esbuild/linux-arm': 0.25.0 - '@esbuild/linux-arm64': 0.25.0 - '@esbuild/linux-ia32': 0.25.0 - '@esbuild/linux-loong64': 0.25.0 - '@esbuild/linux-mips64el': 0.25.0 - '@esbuild/linux-ppc64': 0.25.0 - '@esbuild/linux-riscv64': 0.25.0 - '@esbuild/linux-s390x': 0.25.0 - '@esbuild/linux-x64': 0.25.0 - '@esbuild/netbsd-arm64': 0.25.0 - '@esbuild/netbsd-x64': 0.25.0 - '@esbuild/openbsd-arm64': 0.25.0 - '@esbuild/openbsd-x64': 0.25.0 - '@esbuild/sunos-x64': 0.25.0 - '@esbuild/win32-arm64': 0.25.0 - '@esbuild/win32-ia32': 0.25.0 - '@esbuild/win32-x64': 0.25.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c escalade@3.2.0: {} @@ -8708,13 +7649,7 @@ snapshots: get-east-asian-width@1.3.0: {} -<<<<<<< HEAD get-intrinsic@1.3.0: -======= - get-func-name@2.0.2: {} - - get-intrinsic@1.2.4: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: call-bind-apply-helpers: 1.0.2 es-define-property: 1.0.1 @@ -8826,8 +7761,6 @@ snapshots: has-bigints@1.1.0: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} has-own-prop@2.0.0: {} @@ -8874,25 +7807,15 @@ snapshots: http-proxy-agent@7.0.2: dependencies: -<<<<<<< HEAD agent-base: 7.1.3 debug: 4.4.0 -======= - agent-base: 7.1.1 - debug: 4.3.7 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: -<<<<<<< HEAD agent-base: 7.1.3 debug: 4.4.0 -======= - agent-base: 7.1.1 - debug: 4.3.7 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c transitivePeerDependencies: - supports-color @@ -9271,10 +8194,6 @@ snapshots: safe-stable-stringify: 2.5.0 triple-beam: 1.4.1 - loupe@3.1.1: - dependencies: - get-func-name: 2.0.2 - loupe@3.1.3: {} lru-cache@10.4.3: {} @@ -9457,11 +8376,7 @@ snapshots: mute-stream@2.0.0: {} -<<<<<<< HEAD nanoid@3.3.10: {} -======= - nanoid@3.3.7: {} ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c natural-compare@1.4.0: {} @@ -9847,7 +8762,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.26.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -9899,17 +8814,10 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 -<<<<<<< HEAD postcss@8.5.3: dependencies: nanoid: 3.3.10 picocolors: 1.1.1 -======= - postcss@8.4.47: - dependencies: - nanoid: 3.3.7 - picocolors: 1.1.0 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c source-map-js: 1.2.1 prelude-ls@1.2.1: {} @@ -10082,15 +8990,10 @@ snapshots: glob: 11.0.1 package-json-from-dist: 1.0.1 -<<<<<<< HEAD rollup@4.35.0: -======= - rollup@4.22.4: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 optionalDependencies: -<<<<<<< HEAD '@rollup/rollup-android-arm-eabi': 4.35.0 '@rollup/rollup-android-arm64': 4.35.0 '@rollup/rollup-darwin-arm64': 4.35.0 @@ -10110,24 +9013,6 @@ snapshots: '@rollup/rollup-win32-arm64-msvc': 4.35.0 '@rollup/rollup-win32-ia32-msvc': 4.35.0 '@rollup/rollup-win32-x64-msvc': 4.35.0 -======= - '@rollup/rollup-android-arm-eabi': 4.22.4 - '@rollup/rollup-android-arm64': 4.22.4 - '@rollup/rollup-darwin-arm64': 4.22.4 - '@rollup/rollup-darwin-x64': 4.22.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.22.4 - '@rollup/rollup-linux-arm-musleabihf': 4.22.4 - '@rollup/rollup-linux-arm64-gnu': 4.22.4 - '@rollup/rollup-linux-arm64-musl': 4.22.4 - '@rollup/rollup-linux-powerpc64le-gnu': 4.22.4 - '@rollup/rollup-linux-riscv64-gnu': 4.22.4 - '@rollup/rollup-linux-s390x-gnu': 4.22.4 - '@rollup/rollup-linux-x64-gnu': 4.22.4 - '@rollup/rollup-linux-x64-musl': 4.22.4 - '@rollup/rollup-win32-arm64-msvc': 4.22.4 - '@rollup/rollup-win32-ia32-msvc': 4.22.4 - '@rollup/rollup-win32-x64-msvc': 4.22.4 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c fsevents: 2.3.3 run-parallel@1.2.0: @@ -10296,15 +9181,9 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: -<<<<<<< HEAD agent-base: 7.1.3 debug: 4.4.0 socks: 2.8.4 -======= - agent-base: 7.1.1 - debug: 4.3.7 - socks: 2.8.3 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c transitivePeerDependencies: - supports-color @@ -10352,11 +9231,6 @@ snapshots: statuses@2.0.1: {} -<<<<<<< HEAD -======= - std-env@3.7.0: {} - ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c std-env@3.8.1: {} stdin-discarder@0.2.2: {} @@ -10441,10 +9315,6 @@ snapshots: strnum@2.0.5: {} - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -10557,20 +9427,15 @@ snapshots: tsx@4.19.3: dependencies: -<<<<<<< HEAD esbuild: 0.25.1 get-tsconfig: 4.10.0 -======= - esbuild: 0.25.0 - get-tsconfig: 4.8.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optionalDependencies: fsevents: 2.3.3 tuf-js@2.2.1: dependencies: '@tufjs/models': 2.0.1 - debug: 4.3.7 + debug: 4.4.0 make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color @@ -10578,7 +9443,7 @@ snapshots: tuf-js@3.0.1: dependencies: '@tufjs/models': 3.0.1 - debug: 4.3.7 + debug: 4.4.0 make-fetch-happen: 14.0.3 transitivePeerDependencies: - supports-color @@ -10641,7 +9506,6 @@ snapshots: typedarray@0.0.6: {} -<<<<<<< HEAD typescript-eslint@8.26.1(eslint@9.22.0)(typescript@5.6.3): dependencies: '@typescript-eslint/eslint-plugin': 8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0)(typescript@5.6.3))(eslint@9.22.0)(typescript@5.6.3) @@ -10658,14 +9522,6 @@ snapshots: '@typescript-eslint/parser': 8.26.1(eslint@9.22.0)(typescript@5.7.3) '@typescript-eslint/utils': 8.26.1(eslint@9.22.0)(typescript@5.7.3) eslint: 9.22.0 -======= - typescript-eslint@8.26.0(eslint@9.11.1)(typescript@5.7.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - eslint: 9.11.1 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c typescript: 5.7.3 transitivePeerDependencies: - supports-color @@ -10731,7 +9587,7 @@ snapshots: dependencies: browserslist: 4.24.4 escalade: 3.2.0 - picocolors: 1.1.0 + picocolors: 1.1.1 uri-js@4.4.1: dependencies: @@ -10760,21 +9616,13 @@ snapshots: vary@1.1.2: {} -<<<<<<< HEAD vite-node@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): -======= - vite-node@3.0.8(@types/node@22.5.5): ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.3 -<<<<<<< HEAD vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) -======= - vite: 5.4.8(@types/node@22.5.5) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c transitivePeerDependencies: - '@types/node' - jiti @@ -10789,36 +9637,21 @@ snapshots: - tsx - yaml -<<<<<<< HEAD vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: esbuild: 0.25.1 postcss: 8.5.3 rollup: 4.35.0 -======= - vite@5.4.8(@types/node@22.5.5): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.47 - rollup: 4.22.4 ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c optionalDependencies: '@types/node': 22.5.5 fsevents: 2.3.3 tsx: 4.19.3 yaml: 2.7.0 -<<<<<<< HEAD vitest@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: '@vitest/expect': 3.0.8 '@vitest/mocker': 3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0)) -======= - vitest@3.0.8(@types/node@22.5.5): - dependencies: - '@vitest/expect': 3.0.8 - '@vitest/mocker': 3.0.8(vite@5.4.8(@types/node@22.5.5)) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c '@vitest/pretty-format': 3.0.8 '@vitest/runner': 3.0.8 '@vitest/snapshot': 3.0.8 @@ -10834,13 +9667,8 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 -<<<<<<< HEAD vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) vite-node: 3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) -======= - vite: 5.4.8(@types/node@22.5.5) - vite-node: 3.0.8(@types/node@22.5.5) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.5.5 @@ -10944,15 +9772,6 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 -<<<<<<< HEAD -======= - winston-transport@4.7.1: - dependencies: - logform: 2.6.1 - readable-stream: 3.6.2 - triple-beam: 1.4.1 - ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c winston-transport@4.9.0: dependencies: logform: 2.7.0 From e93f16fd667c3b6cb02a3aeff15a7413700817d4 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 18 Mar 2025 07:29:58 +0000 Subject: [PATCH 07/13] update --- .../azure_key_credential/generated/setup.py | 2 + .../specification/basic/generated/setup.py | 2 + .../directives/generated/setup.py | 2 + .../management/generated/setup.py | 2 + .../AzureBodyDuration/setup.py | 2 + .../AzureParameterGrouping/setup.py | 2 + .../AcceptanceTests/AzureReport/setup.py | 2 + .../AcceptanceTests/AzureSpecials/setup.py | 2 + .../AcceptanceTests/CustomBaseUri/setup.py | 2 + .../CustomPollerPager/setup.py | 2 + .../AcceptanceTests/CustomUrlPaging/setup.py | 2 + .../Expected/AcceptanceTests/Head/setup.py | 2 + .../AcceptanceTests/HeadExceptions/setup.py | 2 + .../HeadWithAzureKeyCredentialPolicy/setup.py | 2 + .../Expected/AcceptanceTests/Lro/setup.py | 2 + .../LroWithParameterizedEndpoints/setup.py | 2 + .../AcceptanceTests/MixedApiVersion/setup.py | 2 + .../PackageModeBatch/MANIFEST.in | 2 +- .../PackageModeDataPlane/MANIFEST.in | 2 +- .../PackageModeMgmtPlane/MANIFEST.in | 2 +- .../Expected/AcceptanceTests/Paging/setup.py | 2 + .../SecurityAadSwagger/setup.py | 2 + .../SecurityKeySwagger/setup.py | 2 + .../StorageManagementClient/setup.py | 2 + .../SubscriptionIdApiVersion/setup.py | 2 + .../AzureBodyDurationVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../AzureReportVersionTolerant/setup.py | 2 + .../AzureSpecialsVersionTolerant/setup.py | 2 + .../CustomBaseUriVersionTolerant/setup.py | 2 + .../CustomPollerPagerVersionTolerant/setup.py | 2 + .../CustomUrlPagingVersionTolerant/setup.py | 2 + .../HeadExceptionsVersionTolerant/setup.py | 2 + .../HeadVersionTolerant/setup.py | 2 + .../LroPagingVersionTolerant/setup.py | 2 + .../LroVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../PagingVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../DPGTestModelsVersionTolerant/setup.py | 2 + .../AdditionalProperties/setup.py | 2 + .../AcceptanceTests/Anything/setup.py | 2 + .../AcceptanceTests/BodyArray/setup.py | 2 + .../BodyArrayWithNamespaceFolders/setup.py | 2 + .../AcceptanceTests/BodyBinary/setup.py | 2 + .../AcceptanceTests/BodyBoolean/setup.py | 2 + .../AcceptanceTests/BodyByte/setup.py | 2 + .../BodyByteWithPackageName/setup.py | 2 + .../AcceptanceTests/BodyComplex/setup.py | 2 + .../AcceptanceTests/BodyDate/setup.py | 2 + .../AcceptanceTests/BodyDateTime/setup.py | 2 + .../BodyDateTimeRfc1123/setup.py | 2 + .../AcceptanceTests/BodyDictionary/setup.py | 2 + .../AcceptanceTests/BodyDuration/setup.py | 2 + .../AcceptanceTests/BodyFile/setup.py | 2 + .../AcceptanceTests/BodyFormData/setup.py | 2 + .../BodyFormUrlEncodedData/setup.py | 2 + .../AcceptanceTests/BodyInteger/setup.py | 2 + .../AcceptanceTests/BodyNumber/setup.py | 2 + .../AcceptanceTests/BodyString/setup.py | 2 + .../AcceptanceTests/BodyTime/setup.py | 2 + .../AcceptanceTests/ClientEnum/setup.py | 2 + .../AcceptanceTests/Constants/setup.py | 2 + .../AcceptanceTests/CustomBaseUri/setup.py | 2 + .../CustomBaseUriMoreOptions/setup.py | 2 + .../AcceptanceTests/ErrorWithSecrets/setup.py | 2 + .../AcceptanceTests/ExtensibleEnums/setup.py | 2 + .../Expected/AcceptanceTests/Header/setup.py | 2 + .../Expected/AcceptanceTests/Http/setup.py | 2 + .../IncorrectErrorResponse/setup.py | 2 + .../InternalOperation/MANIFEST.in | 2 +- .../AcceptanceTests/MediaTypes/setup.py | 2 + .../AcceptanceTests/MergePatchJson/setup.py | 2 + .../AcceptanceTests/ModelFlattening/setup.py | 2 + .../MultipleInheritance/setup.py | 2 + .../AcceptanceTests/NoOperations/setup.py | 2 + .../AcceptanceTests/NonStringEnums/setup.py | 2 + .../AcceptanceTests/ObjectType/setup.py | 2 + .../PackageModeDataPlane/MANIFEST.in | 2 +- .../ParameterFlattening/setup.py | 2 + .../ParameterizedEndpoint/setup.py | 2 + .../Expected/AcceptanceTests/Report/setup.py | 2 + .../AcceptanceTests/RequiredOptional/setup.py | 2 + .../AcceptanceTests/ReservedWords/setup.py | 2 + .../SecurityAadSwagger/setup.py | 2 + .../SecurityAadSwaggerCredentialFlag/setup.py | 2 + .../SecurityKeySwagger/setup.py | 2 + .../SecurityKeySwaggerCredentialFlag/setup.py | 2 + .../Expected/AcceptanceTests/Url/setup.py | 2 + .../UrlMultiCollectionFormat/setup.py | 2 + .../AcceptanceTests/Validation/setup.py | 2 + .../Expected/AcceptanceTests/Xml/setup.py | 2 + .../AcceptanceTests/XmsErrorResponse/setup.py | 2 + .../setup.py | 2 + .../AnythingVersionTolerant/setup.py | 2 + .../BodyArrayVersionTolerant/setup.py | 2 + .../BodyBinaryVersionTolerant/setup.py | 2 + .../BodyBooleanVersionTolerant/setup.py | 2 + .../BodyByteVersionTolerant/setup.py | 2 + .../BodyComplexVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../BodyDateTimeVersionTolerant/setup.py | 2 + .../BodyDateVersionTolerant/setup.py | 2 + .../BodyDictionaryVersionTolerant/setup.py | 2 + .../BodyDurationVersionTolerant/setup.py | 2 + .../BodyFileVersionTolerant/setup.py | 2 + .../BodyFormDataVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../BodyIntegerVersionTolerant/setup.py | 2 + .../BodyNumberVersionTolerant/setup.py | 2 + .../BodyStringVersionTolerant/setup.py | 2 + .../BodyTimeVersionTolerant/setup.py | 2 + .../ClientEnumVersionTolerant/setup.py | 2 + .../ConstantsVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../CustomBaseUriVersionTolerant/setup.py | 2 + .../ErrorWithSecretsVersionTolerant/setup.py | 2 + .../ExtensibleEnumsVersionTolerant/setup.py | 2 + .../HeaderVersionTolerant/setup.py | 2 + .../HttpVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../MediaTypesVersionTolerant/setup.py | 2 + .../MergePatchJsonVersionTolerant/setup.py | 2 + .../ModelFlatteningVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../NoNamespaceFlagVersionTolerant/setup.py | 2 + .../NoOperationsVersionTolerant/setup.py | 2 + .../NonStringEnumsVersionTolerant/setup.py | 2 + .../ObjectTypeVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../ReportVersionTolerant/setup.py | 2 + .../RequiredOptionalVersionTolerant/setup.py | 2 + .../ReservedWordsVersionTolerant/setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../setup.py | 2 + .../UrlVersionTolerant/setup.py | 2 + .../ValidationVersionTolerant/setup.py | 2 + .../XmlVersionTolerant/setup.py | 2 + .../XmsErrorResponseVersionTolerant/setup.py | 2 + packages/typespec-python/package.json | 2 +- .../generated/authentication-api-key/setup.py | 7 +- .../authentication-http-custom/setup.py | 7 +- .../generated/authentication-oauth2/setup.py | 7 +- .../generated/authentication-union/setup.py | 7 +- .../setup.py | 7 +- .../setup.py | 7 +- .../setup.py | 7 +- .../azure/generated/azure-core-basic/setup.py | 7 +- .../azure-core-lro-standard/setup.py | 7 +- .../azure/generated/azure-core-model/setup.py | 7 +- .../azure/generated/azure-core-page/setup.py | 7 +- .../generated/azure-core-scalar/setup.py | 7 +- .../generated/azure-core-traits/setup.py | 7 +- .../generated/azure-example-basic/setup.py | 7 +- .../generated/azure-payload-pageable/setup.py | 7 +- .../setup.py | 7 +- .../setup.py | 7 +- .../azure-resource-manager-resources/setup.py | 7 +- .../setup.py | 7 +- .../generated/azurecore-lro-rpc/setup.py | 7 +- .../azure/generated/client-namespace/setup.py | 7 +- .../azure/generated/client-naming/setup.py | 7 +- .../client-structure-default/setup.py | 7 +- .../client-structure-multiclient/setup.py | 7 +- .../setup.py | 7 +- .../setup.py | 7 +- .../azure/generated/encode-bytes/setup.py | 7 +- .../azure/generated/encode-datetime/setup.py | 7 +- .../azure/generated/encode-duration/setup.py | 7 +- .../azure/generated/encode-numeric/setup.py | 7 +- .../generated/headasbooleanfalse/setup.py | 7 +- .../generated/headasbooleantrue/setup.py | 7 +- .../azure/generated/parameters-basic/setup.py | 7 +- .../parameters-body-optionality/setup.py | 7 +- .../parameters-collection-format/setup.py | 7 +- .../generated/parameters-spread/setup.py | 7 +- .../payload-content-negotiation/setup.py | 7 +- .../payload-json-merge-patch/setup.py | 7 +- .../generated/payload-media-type/setup.py | 7 +- .../generated/payload-multipart/setup.py | 7 +- .../pageable/aio/operations/_operations.py | 416 ------------------ .../operations/_operations.py | 127 ------ .../azure/generated/payload-pageable/setup.py | 7 +- .../test/azure/generated/payload-xml/setup.py | 7 +- .../generated/resiliency-srv-driven1/setup.py | 7 +- .../generated/resiliency-srv-driven2/setup.py | 7 +- .../response-status-code-range/setup.py | 7 +- .../test/azure/generated/routes/setup.py | 7 +- .../serialization-encoded-name-json/setup.py | 7 +- .../server-endpoint-not-defined/setup.py | 7 +- .../generated/server-path-multiple/setup.py | 7 +- .../generated/server-path-single/setup.py | 7 +- .../server-versions-not-versioned/setup.py | 7 +- .../server-versions-versioned/setup.py | 7 +- .../setup.py | 7 +- .../special-headers-repeatability/setup.py | 7 +- .../azure/generated/special-words/setup.py | 7 +- .../azure/generated/typetest-array/setup.py | 7 +- .../generated/typetest-dictionary/setup.py | 7 +- .../typetest-enum-extensible/setup.py | 7 +- .../generated/typetest-enum-fixed/setup.py | 7 +- .../generated/typetest-model-empty/setup.py | 7 +- .../typetest-model-enumdiscriminator/setup.py | 7 +- .../setup.py | 7 +- .../typetest-model-notdiscriminated/setup.py | 7 +- .../typetest-model-recursive/setup.py | 7 +- .../setup.py | 7 +- .../generated/typetest-model-usage/setup.py | 7 +- .../typetest-model-visibility/setup.py | 7 +- .../setup.py | 7 +- .../typetest-property-nullable/setup.py | 7 +- .../typetest-property-optional/setup.py | 7 +- .../typetest-property-valuetypes/setup.py | 7 +- .../azure/generated/typetest-scalar/setup.py | 7 +- .../azure/generated/typetest-union/setup.py | 7 +- .../azure/generated/versioning-added/setup.py | 7 +- .../versioning-madeoptional/setup.py | 7 +- .../generated/versioning-removed/setup.py | 7 +- .../generated/versioning-renamedfrom/setup.py | 7 +- .../versioning-returntypechangedfrom/setup.py | 7 +- .../versioning-typechangedfrom/setup.py | 7 +- .../generated/authentication-api-key/setup.py | 7 +- .../authentication-http-custom/setup.py | 7 +- .../generated/authentication-oauth2/setup.py | 7 +- .../generated/authentication-union/setup.py | 7 +- .../unbranded/generated/encode-bytes/setup.py | 7 +- .../generated/encode-datetime/setup.py | 7 +- .../generated/encode-duration/setup.py | 7 +- .../generated/encode-numeric/setup.py | 7 +- .../generated/headasbooleanfalse/setup.py | 7 +- .../generated/headasbooleantrue/setup.py | 7 +- .../generated/parameters-basic/setup.py | 7 +- .../parameters-body-optionality/setup.py | 7 +- .../parameters-collection-format/setup.py | 7 +- .../generated/parameters-spread/setup.py | 7 +- .../payload-content-negotiation/setup.py | 7 +- .../payload-json-merge-patch/setup.py | 7 +- .../generated/payload-media-type/setup.py | 7 +- .../generated/payload-multipart/setup.py | 7 +- .../generated/payload-pageable/setup.py | 7 +- .../unbranded/generated/payload-xml/setup.py | 7 +- .../response-status-code-range/setup.py | 7 +- .../test/unbranded/generated/routes/setup.py | 7 +- .../serialization-encoded-name-json/setup.py | 7 +- .../server-endpoint-not-defined/setup.py | 7 +- .../generated/server-path-multiple/setup.py | 7 +- .../generated/server-path-single/setup.py | 7 +- .../server-versions-not-versioned/setup.py | 7 +- .../server-versions-versioned/setup.py | 7 +- .../setup.py | 7 +- .../special-headers-repeatability/setup.py | 7 +- .../generated/special-words/setup.py | 7 +- .../generated/typetest-array/setup.py | 7 +- .../generated/typetest-dictionary/setup.py | 7 +- .../typetest-enum-extensible/setup.py | 7 +- .../generated/typetest-enum-fixed/setup.py | 7 +- .../generated/typetest-model-empty/setup.py | 7 +- .../typetest-model-enumdiscriminator/setup.py | 7 +- .../setup.py | 7 +- .../typetest-model-notdiscriminated/setup.py | 7 +- .../typetest-model-recursive/setup.py | 7 +- .../setup.py | 7 +- .../generated/typetest-model-usage/setup.py | 7 +- .../typetest-model-visibility/setup.py | 7 +- .../setup.py | 7 +- .../typetest-property-nullable/setup.py | 7 +- .../typetest-property-optional/setup.py | 7 +- .../typetest-property-valuetypes/setup.py | 7 +- .../generated/typetest-scalar/setup.py | 7 +- .../generated/typetest-union/setup.py | 7 +- .../generated/versioning-added/setup.py | 7 +- .../versioning-madeoptional/setup.py | 7 +- .../generated/versioning-removed/setup.py | 7 +- .../generated/versioning-renamedfrom/setup.py | 7 +- .../versioning-returntypechangedfrom/setup.py | 7 +- .../versioning-typechangedfrom/setup.py | 7 +- pnpm-lock.yaml | 290 ++++++------ 284 files changed, 969 insertions(+), 1096 deletions(-) delete mode 100644 packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py diff --git a/packages/autorest.python/samples/specification/azure_key_credential/generated/setup.py b/packages/autorest.python/samples/specification/azure_key_credential/generated/setup.py index 6786a9e747d..e0e86a47f02 100644 --- a/packages/autorest.python/samples/specification/azure_key_credential/generated/setup.py +++ b/packages/autorest.python/samples/specification/azure_key_credential/generated/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "azure-key-credential-sample" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/samples/specification/basic/generated/setup.py b/packages/autorest.python/samples/specification/basic/generated/setup.py index c8ca6c3bb33..5fe644cdffd 100644 --- a/packages/autorest.python/samples/specification/basic/generated/setup.py +++ b/packages/autorest.python/samples/specification/basic/generated/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "azure-basic-sample" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/samples/specification/directives/generated/setup.py b/packages/autorest.python/samples/specification/directives/generated/setup.py index f570ec897a7..8d902274493 100644 --- a/packages/autorest.python/samples/specification/directives/generated/setup.py +++ b/packages/autorest.python/samples/specification/directives/generated/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "azure-directives-sample" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/samples/specification/management/generated/setup.py b/packages/autorest.python/samples/specification/management/generated/setup.py index cd17a61ba91..f81a912e3a9 100644 --- a/packages/autorest.python/samples/specification/management/generated/setup.py +++ b/packages/autorest.python/samples/specification/management/generated/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "azure-mgmt-sample" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/setup.py index 441e3d62760..653729e614a 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdurationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/setup.py index eba8c8bd77c..930f290fd8b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparametergroupingtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/setup.py index f19286fa333..46384eecbe4 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestreportserviceforazure" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/setup.py index 58451de6e36..f54528d9250 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestazurespecialparameterstestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py index 0ff8110e540..22004f483ab 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/setup.py index 117ffcf6b2d..b7067f8233b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "custompollerpager" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/setup.py index 9ba0667f5d2..f2b7f75118f 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestpagingclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/setup.py index a54bffd0e9f..afdaf860d46 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestheadtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/setup.py index a7b4392f2b0..71be2c94264 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestheadexceptiontestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/setup.py index a54bffd0e9f..afdaf860d46 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestheadtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/setup.py index ffa857cbb99..f26b652e808 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestlongrunningoperationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/setup.py index e3b1a606992..8460633cb93 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "lrowithparamaterizedendpoints" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/setup.py index 63c81926f5b..257d90f7a5e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "mixedapiversion" version = "1.0.0b1" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/MANIFEST.in b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/MANIFEST.in index 9bf1e7d2143..b27b04f8573 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/MANIFEST.in +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/MANIFEST.in @@ -4,4 +4,4 @@ include azure/packagemode/batch/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/packagemode/__init__.py \ No newline at end of file +include azure/packagemode/__init__.py diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in index f35a2d5f0f6..4821ff6342b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in @@ -4,4 +4,4 @@ include azure/packagemode/dataplane/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/packagemode/__init__.py \ No newline at end of file +include azure/packagemode/__init__.py diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/MANIFEST.in b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/MANIFEST.in index eb2912c3f98..398c6c8cc65 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/MANIFEST.in +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/MANIFEST.in @@ -4,4 +4,4 @@ include azure/package/mode/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py -include azure/package/__init__.py \ No newline at end of file +include azure/package/__init__.py diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/setup.py index 5920bfc3992..275d4f8746d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestpagingtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py index 27aa058cd53..5a8f5ce578d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecurityaad" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py index e8875781d77..3c25c8b6d22 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecuritykey" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/setup.py index c6ea32dace6..32647a8ea2b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "storagemanagementclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py index 52addf5dbf5..74c4f5d7dea 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "microsoftazuretesturl" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/setup.py index cca88fbe781..0b48e94577e 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdurationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/setup.py index 7d785b85b57..d4139cd7a38 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparametergroupingtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/setup.py index b6c62804fe8..b4a75e73a2d 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestreportserviceforazure" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/setup.py index 2697f1fb0ab..3af5949a7c6 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestazurespecialparameterstestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py index 88ef6944b5f..ce19f60785a 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/setup.py index 7db9c0e09ff..da9be452d90 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "custompollerpagerversiontolerant" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/setup.py index 9dabe1d24f4..62a006517f1 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestpagingclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/setup.py index ea622886989..4964ebea298 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestheadexceptiontestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/setup.py index f73cb48104d..f3ab2b6688e 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestheadtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/setup.py index 86e99d8ba4e..f3812497628 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/setup.py @@ -12,6 +12,8 @@ PACKAGE_NAME = "lropagingversiontolerant" version = "1.0.0b1" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/setup.py index 514db224def..e2eb7738bda 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestlongrunningoperationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/setup.py index 861804c70d6..1684b24f331 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "lrowithparamaterizedendpoints" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/setup.py index 77234b6b56d..3af7c093472 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestpagingtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/setup.py index b3467979e2b..e1e82c1649b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "storagemanagementclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/setup.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/setup.py index 405131fc562..98aa44b168d 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/setup.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "microsoftazuretesturl" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/setup.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/setup.py index b187c64f283..f53814b4864 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/setup.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "dpgcustomizationcustomized" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/setup.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/setup.py index 7cdd55dc669..cd7733e84ec 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/setup.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "dpgcustomizationinitial" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/setup.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/setup.py index 023eb858c36..48c3211b6ca 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/setup.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "dpgservicedriveninitial" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/setup.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/setup.py index 120f043bf3e..c9c07fabc07 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/setup.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "dpgservicedrivenupdateone" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/setup.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/setup.py index 12f0e3cc220..855b519d045 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/setup.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "dpgtestmodels" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/setup.py index 6671109b377..1101f9e8369 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "additionalpropertiesclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/setup.py index e41f7d898bb..5d30c96ab4a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/setup.py @@ -12,6 +12,8 @@ PACKAGE_NAME = "anythingclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/setup.py index 583b02e9771..00711390d22 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatarrayservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py index 583b02e9771..00711390d22 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatarrayservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/setup.py index c3e608f2427..c0f7fd236a2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "binarywithcontenttypeapplicationjson" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/setup.py index 6c87ebda6fd..44de0762b9f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestbooltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/setup.py index cb0037bdbad..aad1c893a0e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatbyteservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/setup.py index 60e4af61fa9..abcb8ee6d21 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "packagename" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/setup.py index a1ca38467fd..59d4ad72f1e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestcomplextestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/setup.py index a92ceb21961..81f6be58849 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdatetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/setup.py index b58234b0ae6..cc4c3af04c8 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdatetimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/setup.py index 8267e670dde..0dd39e2f714 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestrfc1123datetimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/setup.py index 850884fef7b..de201d4cf15 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatdictionaryservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/setup.py index 441e3d62760..653729e614a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdurationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/setup.py index 387cd47a705..73ce262cd97 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatfileservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/setup.py index f69c4ef402f..183cf81c1dc 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatformdataservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/setup.py index 7f6e24374ae..77a87faf7a4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "bodyformsdataurlencoded" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/setup.py index 0660084af71..d02f0c6503e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestintegertestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/setup.py index 430a6a54fb2..d7faa5e1d31 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestnumbertestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/setup.py index 387831716ea..5fea53a95a2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/setup.py index e0a7e4007fe..05ba1e1f291 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresttimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/setup.py index e40cfb21699..d390a994621 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "clientwithenum" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/setup.py index 4a00438195a..ee78a9ec946 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerconstantservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py index 0ff8110e540..22004f483ab 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py index 2e1f5e3b2fb..22a367fcda0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedcustomhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/setup.py index 6b9c5d6a185..94e0f6e7a56 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "errorwithsecrets" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/setup.py index 6988ac816bd..74afdf373f0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "petstoreinc" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/setup.py index 61942347121..9a17bfc037a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatheaderservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/setup.py index 43c3780f6c9..d8ed1cfdb1a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresthttpinfrastructuretestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/setup.py index 2b5fdeeeaad..3fbd5643e05 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "incorrectreturnederrormodel" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/MANIFEST.in b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/MANIFEST.in index 0a82b9a90db..ef7385f2c53 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/MANIFEST.in +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include internaloperation/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/setup.py index b153e75fe0c..80c34395339 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "mediatypesclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/setup.py index 8a5b4b6c374..10e2149d23f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "mergepatchjsonclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/setup.py index 7e08548c3ed..458fd036f72 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestresourceflatteningtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/setup.py index 31dbf947f9a..f0b7729b56b 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "multipleinheritanceserviceclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NoOperations/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NoOperations/setup.py index 0ebb700fb34..3fe3c52171a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NoOperations/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NoOperations/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "nooperationsserviceclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/setup.py index 56950a6abc5..8c4784605f1 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "nonstringenumsclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/setup.py index 876a6d45dd9..d942416be41 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "objecttypeclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in index 46f6b2959bc..7888b67399a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/MANIFEST.in @@ -2,4 +2,4 @@ include *.md include LICENSE include packagemode/py.typed recursive-include tests *.py -recursive-include samples *.py *.md \ No newline at end of file +recursive-include samples *.py *.md diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/setup.py index f8f353cb2c6..6ade32429b9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterflattening" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/setup.py index 105f8177a73..49973c9db48 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "parmaterizedendpointclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/setup.py index 8b5196b0446..50c657b65e5 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestreportservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/setup.py index 229ebe1c0c0..7c93839e989 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestrequiredoptionaltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/setup.py index 03ee14869d4..fe6808c4ebf 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "reservedwordsclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py index d178b62a467..b82dd13c5a5 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecurityaad" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/setup.py index de06bd58ea5..cfd5df9ed7e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "securityaadswaggercredentialflag" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py index 297abb23fb7..61b66e5ebd4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecuritykey" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/setup.py index 2d7bcaeecc3..8954ecbf5ba 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "securitykeyswaggercredentialflag" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/setup.py index 0c6502e150b..fbe6a2a4c84 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresturltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/setup.py index 3263402b1c9..4c37dddb78a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresturlmutlicollectionformattestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/setup.py index af4bf85fa0b..b9c595d56d5 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestvalidationtest" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/setup.py index 552eaa045b7..6d8c60926f4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatxmlservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/setup.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/setup.py index 6419d715a81..9c66e595c66 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/setup.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "xmserrorresponseextensions" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/setup.py index bd569a68f73..9b65b921659 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "additionalpropertiesclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/setup.py index f06a9d2ede9..b42595e41e6 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/setup.py @@ -12,6 +12,8 @@ PACKAGE_NAME = "anythingclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/setup.py index f0cc24e9820..d89dbaa6ed4 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatarrayservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/setup.py index 5aac267f912..0f4fe64d504 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "binarywithcontenttypeapplicationjson" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/setup.py index 0d92a77a910..ed7c9b9f0f5 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestbooltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/setup.py index adc3719bcb8..02eeac214b6 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatbyteservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/setup.py index 3ed7f5d2a55..d39bbe6c7a4 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestcomplextestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/setup.py index 473afb2fb32..288b95743b2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestrfc1123datetimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/setup.py index 87c051c7dfd..5d0effd6dad 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdatetimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/setup.py index aea4ccce715..c2abaefcd12 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdatetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/setup.py index b027672bef4..362ddfc976f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatdictionaryservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/setup.py index cca88fbe781..0b48e94577e 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestdurationtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/setup.py index ef14216fecf..b90888698b2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatfileservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py index 3b4f72a503d..7ce1a4e540f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatformdataservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormUrlEncodedDataVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormUrlEncodedDataVersionTolerant/setup.py index 384e3fe945c..e4361857ad7 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormUrlEncodedDataVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormUrlEncodedDataVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "bodyformsdataurlencoded" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/setup.py index a7f0f977249..3c5c2054878 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestintegertestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/setup.py index 2829f296b86..7499a11a17c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestnumbertestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/setup.py index 525eeff1ef7..4137f6dc0f1 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/setup.py index 26e2f7026ae..a24232f172c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresttimetestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/setup.py index e3b44f60c21..2b088c2ed6c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "clientwithenum" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/setup.py index e2606285fcf..aeb55d9bab3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerconstantservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/setup.py index 513fd821095..950c93bde6f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedcustomhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py index 88ef6944b5f..ce19f60785a 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterizedhosttestclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/setup.py index 0b9b7736354..db3e586880c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "errorwithsecrets" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/setup.py index 32559b03bc6..80eed7d2130 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "petstoreinc" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/setup.py index 48a1b21276d..ce1d58eda56 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatheaderservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/setup.py index b485220c578..0b3eb23d89b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresthttpinfrastructuretestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/setup.py index ff8f4db03cf..95f2da98970 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "incorrectreturnederrormodel" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/setup.py index 239ecc92a0b..869749bcb27 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "mediatypesclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/setup.py index f46dd4186f2..83b2c4c83b7 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "mergepatchjsonclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/setup.py index 8a3d295fef5..9a1cbdb117d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestresourceflatteningtestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/setup.py index 5e62651f194..46d4604799e 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "multipleinheritanceserviceclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/setup.py index ae60df4bd12..9664313a7a3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/setup.py @@ -12,6 +12,8 @@ PACKAGE_NAME = "nonamespaceflag" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoOperationsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoOperationsVersionTolerant/setup.py index b3c6309d0a4..772f56735b3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoOperationsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoOperationsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "nooperationsserviceclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/setup.py index 84281a7cc40..19dc0f2e76a 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "nonstringenumsclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/setup.py index 0bb595b434d..a5eeb94f9c3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "objecttypeclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/setup.py index 3392ff212c5..d8005e12ca8 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestparameterflattening" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/setup.py index 628deb35f60..d3f6d58d3ff 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "parmaterizedendpointclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/setup.py index 8a77a321b01..3650da12d0d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestreportservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/setup.py index 0e1f19cd83c..5d35a52c686 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestrequiredoptionaltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/setup.py index d62285225d7..b326ebd2b8f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "reservedwordsclient" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/setup.py index e8ba4995ab2..716dd5a6464 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecurityaad" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/setup.py index dd75e96a997..ccda2f6a4db 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestsecuritykey" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/setup.py index 84c437caa76..68107ff06d2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresturlmutlicollectionformattestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/setup.py index d78ad3d05bd..469275ab8be 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autoresturltestservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/setup.py index e1ba5c6a8d8..525e6884ee0 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestvalidationtest" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/setup.py index a57a714208c..a3a6fb55ebe 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "autorestswaggerbatxmlservice" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/setup.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/setup.py index c0688ebdecd..ec653b77580 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/setup.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/setup.py @@ -11,6 +11,8 @@ PACKAGE_NAME = "xmserrorresponseextensions" version = "0.1.0" + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 5793e7dd7cb..875c69c90b0 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -86,7 +86,7 @@ "rimraf": "~6.0.1", "typescript": "~5.7.3", "typescript-eslint": "^8.26.1", - "vitest": "^3.0.8", + "vitest": "^3.0.9", "yargs": "~17.7.2" } } diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py b/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py index 75ca4137c9e..ae301a6bbc7 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-apikey" -PACKAGE_NAMESPACE = "authentication.apikey" PACKAGE_PPRINT_NAME = "Authentication Apikey" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py b/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py index a6c0d1a1a7b..759dbb04636 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-http-custom" -PACKAGE_NAMESPACE = "authentication.http.custom" PACKAGE_PPRINT_NAME = "Authentication Http Custom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py b/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py index b7dbf1ea716..cf71f6ca7bc 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-oauth2" -PACKAGE_NAMESPACE = "authentication.oauth2" PACKAGE_PPRINT_NAME = "Authentication Oauth2" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/authentication-union/setup.py b/packages/typespec-python/test/azure/generated/authentication-union/setup.py index 25db977b7e0..2cf2e990f92 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/setup.py +++ b/packages/typespec-python/test/azure/generated/authentication-union/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-union" -PACKAGE_NAMESPACE = "authentication.union" PACKAGE_PPRINT_NAME = "Authentication Union" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py index 7e0d091f44f..577cd2df3bf 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-access" -PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.access" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Access" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py index 0ee9c1c929f..9569a683c2f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-flattenproperty" -PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.flattenproperty" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Flattenproperty" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py index dae4672f09a..235071e6759 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-clientgenerator-core-usage" -PACKAGE_NAMESPACE = "specs.azure.clientgenerator.core.usage" PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Usage" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py b/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py index 3460f166ea5..8fc0e4fe837 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-basic" -PACKAGE_NAMESPACE = "specs.azure.core.basic" PACKAGE_PPRINT_NAME = "Specs Azure Core Basic" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py index 5b439895560..1290fcc7e55 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-lro-standard" -PACKAGE_NAMESPACE = "specs.azure.core.lro.standard" PACKAGE_PPRINT_NAME = "Specs Azure Core Lro Standard" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/setup.py b/packages/typespec-python/test/azure/generated/azure-core-model/setup.py index 669d45dbb6a..e1f39540178 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-model/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-model" -PACKAGE_NAMESPACE = "specs.azure.core.model" PACKAGE_PPRINT_NAME = "Specs Azure Core Model" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/setup.py b/packages/typespec-python/test/azure/generated/azure-core-page/setup.py index 792cec94ece..f68971a962f 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-page" -PACKAGE_NAMESPACE = "specs.azure.core.page" PACKAGE_PPRINT_NAME = "Specs Azure Core Page" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py index f262a05d768..80f4168d701 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-scalar" -PACKAGE_NAMESPACE = "specs.azure.core.scalar" PACKAGE_PPRINT_NAME = "Specs Azure Core Scalar" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py b/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py index fa6a4de8d3e..429b952b946 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-core-traits" -PACKAGE_NAMESPACE = "specs.azure.core.traits" PACKAGE_PPRINT_NAME = "Specs Azure Core Traits" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py index 4180b71dd5c..d6e671e064b 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-example-basic" -PACKAGE_NAMESPACE = "specs.azure.example.basic" PACKAGE_PPRINT_NAME = "Specs Azure Example Basic" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py index 1941f2ff51b..cc90f0f1958 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specs-azure-payload-pageable" -PACKAGE_NAMESPACE = "specs.azure.payload.pageable" PACKAGE_PPRINT_NAME = "Specs Azure Payload Pageable" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py index 6bd36ac2325..0646ae4dc6e 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "azure-resourcemanager-commonproperties" -PACKAGE_NAMESPACE = "azure.resourcemanager.commonproperties" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Commonproperties" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py index fe3af20d1cc..9ea33e0e256 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "azure-resourcemanager-operationtemplates" -PACKAGE_NAMESPACE = "azure.resourcemanager.operationtemplates" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Operationtemplates" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py index c6ac1585a1e..30edaf2a8fb 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "azure-resourcemanager-resources" -PACKAGE_NAMESPACE = "azure.resourcemanager.resources" PACKAGE_PPRINT_NAME = "Azure Resourcemanager Resources" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py index 9febfc7ae18..c5d4520cdd9 100644 --- a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "azure-specialheaders-xmsclientrequestid" -PACKAGE_NAMESPACE = "azure.specialheaders.xmsclientrequestid" PACKAGE_PPRINT_NAME = "Azure Specialheaders Xmsclientrequestid" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py index 87b48d64ab7..6b2ced72468 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "azurecore-lro-rpc" -PACKAGE_NAMESPACE = "azurecore.lro.rpc" PACKAGE_PPRINT_NAME = "Azurecore Lro Rpc" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-namespace/setup.py b/packages/typespec-python/test/azure/generated/client-namespace/setup.py index 49394ddc8a7..9cefe649c8a 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/setup.py +++ b/packages/typespec-python/test/azure/generated/client-namespace/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-clientnamespace" -PACKAGE_NAMESPACE = "client.clientnamespace" PACKAGE_PPRINT_NAME = "Client Clientnamespace" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-naming/setup.py b/packages/typespec-python/test/azure/generated/client-naming/setup.py index 9dcf5de764a..4caa19959df 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/setup.py +++ b/packages/typespec-python/test/azure/generated/client-naming/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-naming" -PACKAGE_NAMESPACE = "client.naming" PACKAGE_PPRINT_NAME = "Client Naming" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/setup.py b/packages/typespec-python/test/azure/generated/client-structure-default/setup.py index d185242eb43..607f049fabe 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-structure-service" -PACKAGE_NAMESPACE = "client.structure.service" PACKAGE_PPRINT_NAME = "Client Structure Service" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py index 973b557b260..b3eaf8db0f1 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-structure-multiclient" -PACKAGE_NAMESPACE = "client.structure.multiclient" PACKAGE_PPRINT_NAME = "Client Structure Multiclient" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py index 6f48d76701c..6ca49c86070 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-structure-renamedoperation" -PACKAGE_NAMESPACE = "client.structure.renamedoperation" PACKAGE_PPRINT_NAME = "Client Structure Renamedoperation" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py index f7023ecbb49..daf8c469ec6 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "client-structure-twooperationgroup" -PACKAGE_NAMESPACE = "client.structure.twooperationgroup" PACKAGE_PPRINT_NAME = "Client Structure Twooperationgroup" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/setup.py b/packages/typespec-python/test/azure/generated/encode-bytes/setup.py index 4a8e29f8fbc..fd3910dcc68 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-bytes" -PACKAGE_NAMESPACE = "encode.bytes" PACKAGE_PPRINT_NAME = "Encode Bytes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/setup.py b/packages/typespec-python/test/azure/generated/encode-datetime/setup.py index 9ee61830559..cc126a71be3 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-datetime" -PACKAGE_NAMESPACE = "encode.datetime" PACKAGE_PPRINT_NAME = "Encode Datetime" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/setup.py b/packages/typespec-python/test/azure/generated/encode-duration/setup.py index d93787e3491..0f5a7873f2a 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-duration" -PACKAGE_NAMESPACE = "encode.duration" PACKAGE_PPRINT_NAME = "Encode Duration" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/setup.py b/packages/typespec-python/test/azure/generated/encode-numeric/setup.py index 2ac09c33a86..02d7040d463 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/setup.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-numeric" -PACKAGE_NAMESPACE = "encode.numeric" PACKAGE_PPRINT_NAME = "Encode Numeric" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py index 21aea634998..a5d396587ff 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "headasbooleanfalse" -PACKAGE_NAMESPACE = "headasbooleanfalse" PACKAGE_PPRINT_NAME = "Headasbooleanfalse" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py index 5282005e691..e7c30f07752 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "headasbooleantrue" -PACKAGE_NAMESPACE = "headasbooleantrue" PACKAGE_PPRINT_NAME = "Headasbooleantrue" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/setup.py b/packages/typespec-python/test/azure/generated/parameters-basic/setup.py index c00286f9747..de08f6cdecb 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-basic" -PACKAGE_NAMESPACE = "parameters.basic" PACKAGE_PPRINT_NAME = "Parameters Basic" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py index 25fc0d23b09..0ea19d4f766 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-bodyoptionality" -PACKAGE_NAMESPACE = "parameters.bodyoptionality" PACKAGE_PPRINT_NAME = "Parameters Bodyoptionality" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py index e6db6540ca8..415318c0e7c 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-collectionformat" -PACKAGE_NAMESPACE = "parameters.collectionformat" PACKAGE_PPRINT_NAME = "Parameters Collectionformat" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/setup.py b/packages/typespec-python/test/azure/generated/parameters-spread/setup.py index e451c404faf..f040c6b525e 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/setup.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-spread" -PACKAGE_NAMESPACE = "parameters.spread" PACKAGE_PPRINT_NAME = "Parameters Spread" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py index 3da6c9caf95..91c1eac7efa 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-contentnegotiation" -PACKAGE_NAMESPACE = "payload.contentnegotiation" PACKAGE_PPRINT_NAME = "Payload Contentnegotiation" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py index a63cecec63b..88df3d2fc91 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-jsonmergepatch" -PACKAGE_NAMESPACE = "payload.jsonmergepatch" PACKAGE_PPRINT_NAME = "Payload Jsonmergepatch" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/setup.py b/packages/typespec-python/test/azure/generated/payload-media-type/setup.py index f72a4fc8027..c72d277c79e 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-mediatype" -PACKAGE_NAMESPACE = "payload.mediatype" PACKAGE_PPRINT_NAME = "Payload Mediatype" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/setup.py b/packages/typespec-python/test/azure/generated/payload-multipart/setup.py index 04a560fcac6..2982b7e880c 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-multipart" -PACKAGE_NAMESPACE = "payload.multipart" PACKAGE_PPRINT_NAME = "Payload Multipart" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py deleted file mode 100644 index 00578f5274d..00000000000 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/operations/_operations.py +++ /dev/null @@ -1,416 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace - -from ... import models as _models -from ..._model_base import _deserialize -from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_server_driven_pagination_continuation_token_request_header_response_body_request, - build_server_driven_pagination_continuation_token_request_header_response_header_request, - build_server_driven_pagination_continuation_token_request_query_response_body_request, - build_server_driven_pagination_continuation_token_request_query_response_header_request, - build_server_driven_pagination_link_request, -) -from .._configuration import PageableClientConfiguration - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ServerDrivenPaginationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.pageable.aio.PageableClient`'s - :attr:`server_driven_pagination` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def link(self, **kwargs: Any) -> AsyncIterable["_models.Pet"]: - """link. - - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_link_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("next") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ServerDrivenPaginationContinuationTokenOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.pageable.aio.PageableClient`'s - :attr:`continuation_token` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def request_query_response_body( - self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: - """request_query_response_body. - - :keyword foo: Default value is None. - :paramtype foo: str - :keyword bar: Default value is None. - :paramtype bar: str - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_server_driven_pagination_continuation_token_request_query_response_body_request( - token=_continuation_token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def request_header_response_body( - self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: - """request_header_response_body. - - :keyword foo: Default value is None. - :paramtype foo: str - :keyword bar: Default value is None. - :paramtype bar: str - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_server_driven_pagination_continuation_token_request_header_response_body_request( - token=_continuation_token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextToken") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def request_query_response_header( - self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: - """request_query_response_header. - - :keyword foo: Default value is None. - :paramtype foo: str - :keyword bar: Default value is None. - :paramtype bar: str - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_server_driven_pagination_continuation_token_request_query_response_header_request( - token=_continuation_token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def request_header_response_header( - self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Pet"]: - """request_header_response_header. - - :keyword foo: Default value is None. - :paramtype foo: str - :keyword bar: Default value is None. - :paramtype bar: str - :return: An iterator like instance of Pet - :rtype: ~azure.core.async_paging.AsyncItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_server_driven_pagination_continuation_token_request_header_response_header_request( - token=_continuation_token, - foo=foo, - bar=bar, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return pipeline_response.http_response.headers.get("next-token") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 245264b30aa..ee4803f0993 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -140,101 +140,6 @@ def build_server_driven_pagination_continuation_token_request_header_response_he return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py -======= -class ServerDrivenPaginationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~payload.pageable.PageableClient`'s - :attr:`server_driven_pagination` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PageableClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - self.continuation_token = ServerDrivenPaginationContinuationTokenOperations( - self._client, self._config, self._serialize, self._deserialize - ) - - @distributed_trace - def link(self, **kwargs: Any) -> Iterable["_models.Pet"]: - """link. - - :return: An iterator like instance of Pet - :rtype: ~azure.core.paging.ItemPaged[~payload.pageable.models.Pet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Pet]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_server_driven_pagination_link_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - _request = HttpRequest("GET", next_link) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("next") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py class ServerDrivenPaginationContinuationTokenOperations: # pylint: disable=name-too-long """ .. warning:: @@ -255,11 +160,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def request_query_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py ) -> Iterable["_models3.Pet"]: -======= - ) -> Iterable["_models.Pet"]: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py """request_query_response_body. :keyword foo: Default value is None. @@ -300,11 +201,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) -======= - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextToken") or None, iter(list_of_elem) @@ -329,11 +226,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_header_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py ) -> Iterable["_models3.Pet"]: -======= - ) -> Iterable["_models.Pet"]: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py """request_header_response_body. :keyword foo: Default value is None. @@ -374,11 +267,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) -======= - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextToken") or None, iter(list_of_elem) @@ -403,11 +292,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_query_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py ) -> Iterable["_models3.Pet"]: -======= - ) -> Iterable["_models.Pet"]: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py """request_query_response_header. :keyword foo: Default value is None. @@ -448,11 +333,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) -======= - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py if cls: list_of_elem = cls(list_of_elem) # type: ignore return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) @@ -477,11 +358,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_header_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py ) -> Iterable["_models3.Pet"]: -======= - ) -> Iterable["_models.Pet"]: ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py """request_header_response_header. :keyword foo: Default value is None. @@ -522,11 +399,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() -<<<<<<< HEAD:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py list_of_elem = _deserialize(List[_models3.Pet], deserialized.get("pets", [])) -======= - list_of_elem = _deserialize(List[_models.Pet], deserialized.get("pets", [])) ->>>>>>> f1fc2c72143c7b0577f28cbe8e76f33e5390d02c:packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/operations/_operations.py if cls: list_of_elem = cls(list_of_elem) # type: ignore return pipeline_response.http_response.headers.get("next-token") or None, iter(list_of_elem) diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/setup.py b/packages/typespec-python/test/azure/generated/payload-pageable/setup.py index c488cdeacf6..9a2b465020b 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-pageable" -PACKAGE_NAMESPACE = "payload.pageable" PACKAGE_PPRINT_NAME = "Payload Pageable" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/payload-xml/setup.py b/packages/typespec-python/test/azure/generated/payload-xml/setup.py index 55f91ca1551..b23b07fd542 100644 --- a/packages/typespec-python/test/azure/generated/payload-xml/setup.py +++ b/packages/typespec-python/test/azure/generated/payload-xml/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-xml" -PACKAGE_NAMESPACE = "payload.xml" PACKAGE_PPRINT_NAME = "Payload Xml" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py index 91bf8bdba79..4d1275b375c 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "resiliency-srv-driven1" -PACKAGE_NAMESPACE = "resiliency.srv.driven1" PACKAGE_PPRINT_NAME = "ResiliencySrvDriven1" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py index f5c15b726b2..7e8b174127d 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "resiliency-srv-driven2" -PACKAGE_NAMESPACE = "resiliency.srv.driven2" PACKAGE_PPRINT_NAME = "ResiliencySrvDriven2" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py b/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py index 8ead782258a..08d9d67db36 100644 --- a/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py +++ b/packages/typespec-python/test/azure/generated/response-status-code-range/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "response-statuscoderange" -PACKAGE_NAMESPACE = "response.statuscoderange" PACKAGE_PPRINT_NAME = "Response Statuscoderange" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/routes/setup.py b/packages/typespec-python/test/azure/generated/routes/setup.py index 4ec644ed09d..abbeba859d6 100644 --- a/packages/typespec-python/test/azure/generated/routes/setup.py +++ b/packages/typespec-python/test/azure/generated/routes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "routes" -PACKAGE_NAMESPACE = "routes" PACKAGE_PPRINT_NAME = "Routes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py index 9f2ec6fe863..78b33183909 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "serialization-encodedname-json" -PACKAGE_NAMESPACE = "serialization.encodedname.json" PACKAGE_PPRINT_NAME = "Serialization Encodedname Json" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py index 76611cc3812..e4626a83540 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-endpoint-notdefined" -PACKAGE_NAMESPACE = "server.endpoint.notdefined" PACKAGE_PPRINT_NAME = "Server Endpoint Notdefined" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py b/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py index 85e6c12881e..094b0a2b9e0 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-path-multiple" -PACKAGE_NAMESPACE = "server.path.multiple" PACKAGE_PPRINT_NAME = "Server Path Multiple" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-path-single/setup.py b/packages/typespec-python/test/azure/generated/server-path-single/setup.py index e093522a3fe..953611cf578 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/setup.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-path-single" -PACKAGE_NAMESPACE = "server.path.single" PACKAGE_PPRINT_NAME = "Server Path Single" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py index 8e3aef03e59..41a48fd1dad 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-versions-notversioned" -PACKAGE_NAMESPACE = "server.versions.notversioned" PACKAGE_PPRINT_NAME = "Server Versions Notversioned" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py index c723585056e..5fa7ca626f7 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-versions-versioned" -PACKAGE_NAMESPACE = "server.versions.versioned" PACKAGE_PPRINT_NAME = "Server Versions Versioned" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py index aa6b8af3bbd..9c3678798fe 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialheaders-conditionalrequest" -PACKAGE_NAMESPACE = "specialheaders.conditionalrequest" PACKAGE_PPRINT_NAME = "Specialheaders Conditionalrequest" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py b/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py index 3c9ef0b38eb..9f8a19484bc 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialheaders-repeatability" -PACKAGE_NAMESPACE = "specialheaders.repeatability" PACKAGE_PPRINT_NAME = "Specialheaders Repeatability" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/special-words/setup.py b/packages/typespec-python/test/azure/generated/special-words/setup.py index f5e41449cdd..adeea4c3559 100644 --- a/packages/typespec-python/test/azure/generated/special-words/setup.py +++ b/packages/typespec-python/test/azure/generated/special-words/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialwords" -PACKAGE_NAMESPACE = "specialwords" PACKAGE_PPRINT_NAME = "Specialwords" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-array/setup.py b/packages/typespec-python/test/azure/generated/typetest-array/setup.py index 94c929aac58..2ff11c984f4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-array" -PACKAGE_NAMESPACE = "typetest.array" PACKAGE_PPRINT_NAME = "Typetest Array" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py index 0ae820235c5..4bd20841a29 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-dictionary" -PACKAGE_NAMESPACE = "typetest.dictionary" PACKAGE_PPRINT_NAME = "Typetest Dictionary" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py index 794040c67e0..6c4a0721453 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-enum-extensible" -PACKAGE_NAMESPACE = "typetest.enum.extensible" PACKAGE_PPRINT_NAME = "Typetest Enum Extensible" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py index b5d90bbce3f..7deef5c1f89 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-enum-fixed" -PACKAGE_NAMESPACE = "typetest.enum.fixed" PACKAGE_PPRINT_NAME = "Typetest Enum Fixed" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py index 3247f6e9ae4..98432ab7fc8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-empty" -PACKAGE_NAMESPACE = "typetest.model.empty" PACKAGE_PPRINT_NAME = "Typetest Model Empty" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py index 9a4c15ddc19..3613964eea5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-enumdiscriminator" -PACKAGE_NAMESPACE = "typetest.model.enumdiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Enumdiscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py index aca3374855f..0c608caa988 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-nesteddiscriminator" -PACKAGE_NAMESPACE = "typetest.model.nesteddiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Nesteddiscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py index a641f10a4aa..15bd3750372 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-notdiscriminated" -PACKAGE_NAMESPACE = "typetest.model.notdiscriminated" PACKAGE_PPRINT_NAME = "Typetest Model Notdiscriminated" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py index 52061515112..bfd4bf8ac4b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-recursive" -PACKAGE_NAMESPACE = "typetest.model.recursive" PACKAGE_PPRINT_NAME = "Typetest Model Recursive" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py index 209fb736353..cc844eb277f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-singlediscriminator" -PACKAGE_NAMESPACE = "typetest.model.singlediscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Singlediscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py index 160e3a7e0e8..7fc98fdb622 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-usage" -PACKAGE_NAMESPACE = "typetest.model.usage" PACKAGE_PPRINT_NAME = "Typetest Model Usage" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py index a155cc400b5..a4ea73fc4f4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-visibility" -PACKAGE_NAMESPACE = "typetest.model.visibility" PACKAGE_PPRINT_NAME = "Typetest Model Visibility" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py index bc3163f7297..4c63f3e77f9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-additionalproperties" -PACKAGE_NAMESPACE = "typetest.property.additionalproperties" PACKAGE_PPRINT_NAME = "Typetest Property Additionalproperties" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py index 9e2ec035c45..87876e0d12e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-nullable" -PACKAGE_NAMESPACE = "typetest.property.nullable" PACKAGE_PPRINT_NAME = "Typetest Property Nullable" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py index 258b383b19d..7d2a3cd91fe 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-optional" -PACKAGE_NAMESPACE = "typetest.property.optional" PACKAGE_PPRINT_NAME = "Typetest Property Optional" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py index f148d38235d..2cc02c80797 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-valuetypes" -PACKAGE_NAMESPACE = "typetest.property.valuetypes" PACKAGE_PPRINT_NAME = "Typetest Property Valuetypes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py b/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py index e4ff994e2fe..cd06b8845b0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-scalar" -PACKAGE_NAMESPACE = "typetest.scalar" PACKAGE_PPRINT_NAME = "Typetest Scalar" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/setup.py b/packages/typespec-python/test/azure/generated/typetest-union/setup.py index 45d71d7cdb2..587ffd51001 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/setup.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-union" -PACKAGE_NAMESPACE = "typetest.union" PACKAGE_PPRINT_NAME = "Typetest Union" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-added/setup.py b/packages/typespec-python/test/azure/generated/versioning-added/setup.py index 53a52331d16..e04de29ea1a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-added" -PACKAGE_NAMESPACE = "versioning.added" PACKAGE_PPRINT_NAME = "Versioning Added" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py index f40c550e34c..d7818e4f748 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-madeoptional" -PACKAGE_NAMESPACE = "versioning.madeoptional" PACKAGE_PPRINT_NAME = "Versioning Madeoptional" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/setup.py b/packages/typespec-python/test/azure/generated/versioning-removed/setup.py index 95d2ab4300d..c951374f0f9 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-removed" -PACKAGE_NAMESPACE = "versioning.removed" PACKAGE_PPRINT_NAME = "Versioning Removed" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py index 220e00a1259..7c5262de6b7 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-renamedfrom" -PACKAGE_NAMESPACE = "versioning.renamedfrom" PACKAGE_PPRINT_NAME = "Versioning Renamedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py index 21c1f641eb1..883eab7a6bd 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-returntypechangedfrom" -PACKAGE_NAMESPACE = "versioning.returntypechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Returntypechangedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py index 21efd7772ec..623498c7a3f 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-typechangedfrom" -PACKAGE_NAMESPACE = "versioning.typechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Typechangedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py index f185d8fc3c1..08de819a560 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-apikey" -PACKAGE_NAMESPACE = "authentication.apikey" PACKAGE_PPRINT_NAME = "Authentication Apikey" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py index 662fffa0cfa..8c728f9a540 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-http-custom" -PACKAGE_NAMESPACE = "authentication.http.custom" PACKAGE_PPRINT_NAME = "Authentication Http Custom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py index 851ca9fc916..50db5ae8fc0 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-oauth2" -PACKAGE_NAMESPACE = "authentication.oauth2" PACKAGE_PPRINT_NAME = "Authentication Oauth2" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py b/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py index 616f56688c5..216a20fbcb9 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "authentication-union" -PACKAGE_NAMESPACE = "authentication.union" PACKAGE_PPRINT_NAME = "Authentication Union" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py index 40f96a1803c..59e408d18ba 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-bytes" -PACKAGE_NAMESPACE = "encode.bytes" PACKAGE_PPRINT_NAME = "Encode Bytes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py index ba5d3525412..4ae6cfd8dd1 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-datetime" -PACKAGE_NAMESPACE = "encode.datetime" PACKAGE_PPRINT_NAME = "Encode Datetime" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py b/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py index 22972be2783..b03b5a1df62 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-duration" -PACKAGE_NAMESPACE = "encode.duration" PACKAGE_PPRINT_NAME = "Encode Duration" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py index 9582c6982b3..94c985edce5 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "encode-numeric" -PACKAGE_NAMESPACE = "encode.numeric" PACKAGE_PPRINT_NAME = "Encode Numeric" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py index 8cf3473397c..f6feef26f67 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "headasbooleanfalse" -PACKAGE_NAMESPACE = "headasbooleanfalse" PACKAGE_PPRINT_NAME = "Headasbooleanfalse" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py index b692194610e..bcfc0765e97 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "headasbooleantrue" -PACKAGE_NAMESPACE = "headasbooleantrue" PACKAGE_PPRINT_NAME = "Headasbooleantrue" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py index d9dac9b4a50..cda12726e40 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-basic" -PACKAGE_NAMESPACE = "parameters.basic" PACKAGE_PPRINT_NAME = "Parameters Basic" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py index 98bcf0e4f65..eaca7582ed4 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-bodyoptionality" -PACKAGE_NAMESPACE = "parameters.bodyoptionality" PACKAGE_PPRINT_NAME = "Parameters Bodyoptionality" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py index a4877fcbc57..5d567f8431e 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-collectionformat" -PACKAGE_NAMESPACE = "parameters.collectionformat" PACKAGE_PPRINT_NAME = "Parameters Collectionformat" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py index 332ea66ef9c..90dbe71acf0 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "parameters-spread" -PACKAGE_NAMESPACE = "parameters.spread" PACKAGE_PPRINT_NAME = "Parameters Spread" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py index 2feb7711573..4e5cd2ad0e5 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-contentnegotiation" -PACKAGE_NAMESPACE = "payload.contentnegotiation" PACKAGE_PPRINT_NAME = "Payload Contentnegotiation" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py index 45bc2c5168c..a71ba38af71 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-jsonmergepatch" -PACKAGE_NAMESPACE = "payload.jsonmergepatch" PACKAGE_PPRINT_NAME = "Payload Jsonmergepatch" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py b/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py index 9fb923d3b81..fb74d1c390a 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-mediatype" -PACKAGE_NAMESPACE = "payload.mediatype" PACKAGE_PPRINT_NAME = "Payload Mediatype" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py index 5b7ad8c4063..452d45b43bd 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-multipart" -PACKAGE_NAMESPACE = "payload.multipart" PACKAGE_PPRINT_NAME = "Payload Multipart" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py index 38b79a86f00..d6bbb04b6ea 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-pageable" -PACKAGE_NAMESPACE = "payload.pageable" PACKAGE_PPRINT_NAME = "Payload Pageable" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py b/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py index b9eb68e2ed4..a588cd7a4a4 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py +++ b/packages/typespec-python/test/unbranded/generated/payload-xml/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "payload-xml" -PACKAGE_NAMESPACE = "payload.xml" PACKAGE_PPRINT_NAME = "Payload Xml" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py b/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py index 05b05fc599e..34ab0f06afb 100644 --- a/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py +++ b/packages/typespec-python/test/unbranded/generated/response-status-code-range/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "response-statuscoderange" -PACKAGE_NAMESPACE = "response.statuscoderange" PACKAGE_PPRINT_NAME = "Response Statuscoderange" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/routes/setup.py b/packages/typespec-python/test/unbranded/generated/routes/setup.py index 36aef74c500..22d8a517c4d 100644 --- a/packages/typespec-python/test/unbranded/generated/routes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/routes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "routes" -PACKAGE_NAMESPACE = "routes" PACKAGE_PPRINT_NAME = "Routes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py index fa695262c64..db84f208bbf 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "serialization-encodedname-json" -PACKAGE_NAMESPACE = "serialization.encodedname.json" PACKAGE_PPRINT_NAME = "Serialization Encodedname Json" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py index 8e1a19aaee3..bc2f60874b5 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-endpoint-notdefined" -PACKAGE_NAMESPACE = "server.endpoint.notdefined" PACKAGE_PPRINT_NAME = "Server Endpoint Notdefined" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py index 15d5861922c..0c56047e89d 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-path-multiple" -PACKAGE_NAMESPACE = "server.path.multiple" PACKAGE_PPRINT_NAME = "Server Path Multiple" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py b/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py index 994f0202393..dcb4599123e 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-path-single" -PACKAGE_NAMESPACE = "server.path.single" PACKAGE_PPRINT_NAME = "Server Path Single" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py index 5a56d33eec9..7750eac17ce 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-versions-notversioned" -PACKAGE_NAMESPACE = "server.versions.notversioned" PACKAGE_PPRINT_NAME = "Server Versions Notversioned" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py index 52144a95487..b9f424233c1 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "server-versions-versioned" -PACKAGE_NAMESPACE = "server.versions.versioned" PACKAGE_PPRINT_NAME = "Server Versions Versioned" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py index e5ba2e7ea32..77db397e1af 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialheaders-conditionalrequest" -PACKAGE_NAMESPACE = "specialheaders.conditionalrequest" PACKAGE_PPRINT_NAME = "Specialheaders Conditionalrequest" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py index 52ea34bee36..b029b71fd31 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialheaders-repeatability" -PACKAGE_NAMESPACE = "specialheaders.repeatability" PACKAGE_PPRINT_NAME = "Specialheaders Repeatability" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/special-words/setup.py b/packages/typespec-python/test/unbranded/generated/special-words/setup.py index d384daf717e..8276b5b27b7 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/setup.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "specialwords" -PACKAGE_NAMESPACE = "specialwords" PACKAGE_PPRINT_NAME = "Specialwords" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py index 582f80e49b1..4257088d006 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-array" -PACKAGE_NAMESPACE = "typetest.array" PACKAGE_PPRINT_NAME = "Typetest Array" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py index 7b523bc354f..4e6f2fb5188 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-dictionary" -PACKAGE_NAMESPACE = "typetest.dictionary" PACKAGE_PPRINT_NAME = "Typetest Dictionary" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py index d194279140a..c90270498e2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-enum-extensible" -PACKAGE_NAMESPACE = "typetest.enum.extensible" PACKAGE_PPRINT_NAME = "Typetest Enum Extensible" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py index 6aadc36c7e4..4db727616a0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-enum-fixed" -PACKAGE_NAMESPACE = "typetest.enum.fixed" PACKAGE_PPRINT_NAME = "Typetest Enum Fixed" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py index a11180c918a..f5217e3116f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-empty" -PACKAGE_NAMESPACE = "typetest.model.empty" PACKAGE_PPRINT_NAME = "Typetest Model Empty" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py index 1db10e2ca19..436aec6f304 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-enumdiscriminator" -PACKAGE_NAMESPACE = "typetest.model.enumdiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Enumdiscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py index c1485ceb2a5..8fc1fa56e32 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-nesteddiscriminator" -PACKAGE_NAMESPACE = "typetest.model.nesteddiscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Nesteddiscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py index c968d3b33f6..0b6ac56b9a2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-notdiscriminated" -PACKAGE_NAMESPACE = "typetest.model.notdiscriminated" PACKAGE_PPRINT_NAME = "Typetest Model Notdiscriminated" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py index e885c213974..60b4b1cd2c7 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-recursive" -PACKAGE_NAMESPACE = "typetest.model.recursive" PACKAGE_PPRINT_NAME = "Typetest Model Recursive" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py index bf97f5f5bee..62931effded 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-singlediscriminator" -PACKAGE_NAMESPACE = "typetest.model.singlediscriminator" PACKAGE_PPRINT_NAME = "Typetest Model Singlediscriminator" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py index 228646783c8..e28fa125f57 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-usage" -PACKAGE_NAMESPACE = "typetest.model.usage" PACKAGE_PPRINT_NAME = "Typetest Model Usage" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py index 3788797c38c..a801e230e43 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-model-visibility" -PACKAGE_NAMESPACE = "typetest.model.visibility" PACKAGE_PPRINT_NAME = "Typetest Model Visibility" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py index 9eb5026e378..460cb6fcc9e 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-additionalproperties" -PACKAGE_NAMESPACE = "typetest.property.additionalproperties" PACKAGE_PPRINT_NAME = "Typetest Property Additionalproperties" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py index 735c89589e3..1c2ec951ef2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-nullable" -PACKAGE_NAMESPACE = "typetest.property.nullable" PACKAGE_PPRINT_NAME = "Typetest Property Nullable" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py index a5b5040fc65..854209e288a 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-optional" -PACKAGE_NAMESPACE = "typetest.property.optional" PACKAGE_PPRINT_NAME = "Typetest Property Optional" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py index a7cf0bfc898..2953040cf11 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-property-valuetypes" -PACKAGE_NAMESPACE = "typetest.property.valuetypes" PACKAGE_PPRINT_NAME = "Typetest Property Valuetypes" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py index 97427442269..12680f01d12 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-scalar" -PACKAGE_NAMESPACE = "typetest.scalar" PACKAGE_PPRINT_NAME = "Typetest Scalar" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py b/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py index 36d161b1dab..f60b45849d3 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "typetest-union" -PACKAGE_NAMESPACE = "typetest.union" PACKAGE_PPRINT_NAME = "Typetest Union" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py index 378f59769f2..639873619a5 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-added" -PACKAGE_NAMESPACE = "versioning.added" PACKAGE_PPRINT_NAME = "Versioning Added" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py index 55aac7332ff..94c96057f0e 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-madeoptional" -PACKAGE_NAMESPACE = "versioning.madeoptional" PACKAGE_PPRINT_NAME = "Versioning Madeoptional" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py index c9cdb6e7cde..b3cf852415a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-removed" -PACKAGE_NAMESPACE = "versioning.removed" PACKAGE_PPRINT_NAME = "Versioning Removed" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py index ac2db22faa9..94d62cbbe54 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-renamedfrom" -PACKAGE_NAMESPACE = "versioning.renamedfrom" PACKAGE_PPRINT_NAME = "Versioning Renamedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py index 371a9259c46..9fbe67d3060 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-returntypechangedfrom" -PACKAGE_NAMESPACE = "versioning.returntypechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Returntypechangedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py index 09dbba5cd7d..1340ded6d5e 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/setup.py @@ -13,11 +13,10 @@ PACKAGE_NAME = "versioning-typechangedfrom" -PACKAGE_NAMESPACE = "versioning.typechangedfrom" PACKAGE_PPRINT_NAME = "Versioning Typechangedfrom" -# a.b.c => a/b/c -package_folder_path = PACKAGE_NAMESPACE.replace(".", "/") +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: @@ -25,6 +24,8 @@ if not version: raise RuntimeError("Cannot find version information") + + setup( name=PACKAGE_NAME, version=version, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35badf8b569..6d2e6be7276 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -161,8 +161,8 @@ importers: specifier: ^8.26.1 version: 8.26.1(eslint@9.22.0)(typescript@5.7.3) vitest: - specifier: ^3.0.8 - version: 3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) + specifier: ^3.0.9 + version: 3.0.9(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) yargs: specifier: ~17.7.2 version: 17.7.2 @@ -1172,98 +1172,98 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.35.0': - resolution: {integrity: sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==} + '@rollup/rollup-android-arm-eabi@4.36.0': + resolution: {integrity: sha512-jgrXjjcEwN6XpZXL0HUeOVGfjXhPyxAbbhD0BlXUB+abTOpbPiN5Wb3kOT7yb+uEtATNYF5x5gIfwutmuBA26w==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.35.0': - resolution: {integrity: sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==} + '@rollup/rollup-android-arm64@4.36.0': + resolution: {integrity: sha512-NyfuLvdPdNUfUNeYKUwPwKsE5SXa2J6bCt2LdB/N+AxShnkpiczi3tcLJrm5mA+eqpy0HmaIY9F6XCa32N5yzg==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.35.0': - resolution: {integrity: sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==} + '@rollup/rollup-darwin-arm64@4.36.0': + resolution: {integrity: sha512-JQ1Jk5G4bGrD4pWJQzWsD8I1n1mgPXq33+/vP4sk8j/z/C2siRuxZtaUA7yMTf71TCZTZl/4e1bfzwUmFb3+rw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.35.0': - resolution: {integrity: sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==} + '@rollup/rollup-darwin-x64@4.36.0': + resolution: {integrity: sha512-6c6wMZa1lrtiRsbDziCmjE53YbTkxMYhhnWnSW8R/yqsM7a6mSJ3uAVT0t8Y/DGt7gxUWYuFM4bwWk9XCJrFKA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.35.0': - resolution: {integrity: sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==} + '@rollup/rollup-freebsd-arm64@4.36.0': + resolution: {integrity: sha512-KXVsijKeJXOl8QzXTsA+sHVDsFOmMCdBRgFmBb+mfEb/7geR7+C8ypAml4fquUt14ZyVXaw2o1FWhqAfOvA4sg==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.35.0': - resolution: {integrity: sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==} + '@rollup/rollup-freebsd-x64@4.36.0': + resolution: {integrity: sha512-dVeWq1ebbvByI+ndz4IJcD4a09RJgRYmLccwlQ8bPd4olz3Y213uf1iwvc7ZaxNn2ab7bjc08PrtBgMu6nb4pQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.35.0': - resolution: {integrity: sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==} + '@rollup/rollup-linux-arm-gnueabihf@4.36.0': + resolution: {integrity: sha512-bvXVU42mOVcF4le6XSjscdXjqx8okv4n5vmwgzcmtvFdifQ5U4dXFYaCB87namDRKlUL9ybVtLQ9ztnawaSzvg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.35.0': - resolution: {integrity: sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==} + '@rollup/rollup-linux-arm-musleabihf@4.36.0': + resolution: {integrity: sha512-JFIQrDJYrxOnyDQGYkqnNBtjDwTgbasdbUiQvcU8JmGDfValfH1lNpng+4FWlhaVIR4KPkeddYjsVVbmJYvDcg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.35.0': - resolution: {integrity: sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==} + '@rollup/rollup-linux-arm64-gnu@4.36.0': + resolution: {integrity: sha512-KqjYVh3oM1bj//5X7k79PSCZ6CvaVzb7Qs7VMWS+SlWB5M8p3FqufLP9VNp4CazJ0CsPDLwVD9r3vX7Ci4J56A==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.35.0': - resolution: {integrity: sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==} + '@rollup/rollup-linux-arm64-musl@4.36.0': + resolution: {integrity: sha512-QiGnhScND+mAAtfHqeT+cB1S9yFnNQ/EwCg5yE3MzoaZZnIV0RV9O5alJAoJKX/sBONVKeZdMfO8QSaWEygMhw==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.35.0': - resolution: {integrity: sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==} + '@rollup/rollup-linux-loongarch64-gnu@4.36.0': + resolution: {integrity: sha512-1ZPyEDWF8phd4FQtTzMh8FQwqzvIjLsl6/84gzUxnMNFBtExBtpL51H67mV9xipuxl1AEAerRBgBwFNpkw8+Lg==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': - resolution: {integrity: sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==} + '@rollup/rollup-linux-powerpc64le-gnu@4.36.0': + resolution: {integrity: sha512-VMPMEIUpPFKpPI9GZMhJrtu8rxnp6mJR3ZzQPykq4xc2GmdHj3Q4cA+7avMyegXy4n1v+Qynr9fR88BmyO74tg==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.35.0': - resolution: {integrity: sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==} + '@rollup/rollup-linux-riscv64-gnu@4.36.0': + resolution: {integrity: sha512-ttE6ayb/kHwNRJGYLpuAvB7SMtOeQnVXEIpMtAvx3kepFQeowVED0n1K9nAdraHUPJ5hydEMxBpIR7o4nrm8uA==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.35.0': - resolution: {integrity: sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==} + '@rollup/rollup-linux-s390x-gnu@4.36.0': + resolution: {integrity: sha512-4a5gf2jpS0AIe7uBjxDeUMNcFmaRTbNv7NxI5xOCs4lhzsVyGR/0qBXduPnoWf6dGC365saTiwag8hP1imTgag==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.35.0': - resolution: {integrity: sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==} + '@rollup/rollup-linux-x64-gnu@4.36.0': + resolution: {integrity: sha512-5KtoW8UWmwFKQ96aQL3LlRXX16IMwyzMq/jSSVIIyAANiE1doaQsx/KRyhAvpHlPjPiSU/AYX/8m+lQ9VToxFQ==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.35.0': - resolution: {integrity: sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==} + '@rollup/rollup-linux-x64-musl@4.36.0': + resolution: {integrity: sha512-sycrYZPrv2ag4OCvaN5js+f01eoZ2U+RmT5as8vhxiFz+kxwlHrsxOwKPSA8WyS+Wc6Epid9QeI/IkQ9NkgYyQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.35.0': - resolution: {integrity: sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==} + '@rollup/rollup-win32-arm64-msvc@4.36.0': + resolution: {integrity: sha512-qbqt4N7tokFwwSVlWDsjfoHgviS3n/vZ8LK0h1uLG9TYIRuUTJC88E1xb3LM2iqZ/WTqNQjYrtmtGmrmmawB6A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.35.0': - resolution: {integrity: sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==} + '@rollup/rollup-win32-ia32-msvc@4.36.0': + resolution: {integrity: sha512-t+RY0JuRamIocMuQcfwYSOkmdX9dtkr1PbhKW42AMvaDQa+jOdpUYysroTF/nuPpAaQMWp7ye+ndlmmthieJrQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.35.0': - resolution: {integrity: sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==} + '@rollup/rollup-win32-x64-msvc@4.36.0': + resolution: {integrity: sha512-aRXd7tRZkWLqGbChgcMMDEHjOKudo1kChb1Jt1IfR8cY/KIpgNviLeJy5FUb9IpSuQj8dU2fAYNMPW/hLKOSTw==} cpu: [x64] os: [win32] @@ -1441,7 +1441,7 @@ packages: '@typespec/compiler': ~0.66.0 '@typespec/http-client-python@file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz': - resolution: {integrity: sha512-1nU1QHjbrzDLuIU5sAJzYe3Lty18MS2HM1nkoeoGUglxSKVIY3yUx79H6muycPUuJJwo2SYY+xEzDLsnqNwqWg==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz} + resolution: {integrity: sha512-Nn/+J9cpbKGWzpJOWmsSs2/5pAA+pMqiZTmrxPvnB+Zfje1YAIroZzcfQ+jyzcmi/LikQRDonXyGWWl+28fAJQ==, tarball: file:../typespec/packages/http-client-python/typespec-http-client-python-0.8.0.tgz} version: 0.8.0 engines: {node: '>=18.0.0'} peerDependencies: @@ -1530,11 +1530,11 @@ packages: peerDependencies: '@typespec/compiler': ~0.59.0 - '@vitest/expect@3.0.8': - resolution: {integrity: sha512-Xu6TTIavTvSSS6LZaA3EebWFr6tsoXPetOWNMOlc7LO88QVVBwq2oQWBoDiLCN6YTvNYsGSjqOO8CAdjom5DCQ==} + '@vitest/expect@3.0.9': + resolution: {integrity: sha512-5eCqRItYgIML7NNVgJj6TVCmdzE7ZVgJhruW0ziSQV4V7PvLkDL1bBkBdcTs/VuIz0IxPb5da1IDSqc1TR9eig==} - '@vitest/mocker@3.0.8': - resolution: {integrity: sha512-n3LjS7fcW1BCoF+zWZxG7/5XvuYH+lsFg+BDwwAz0arIwHQJFUEsKBQ0BLU49fCxuM/2HSeBPHQD8WjgrxMfow==} + '@vitest/mocker@3.0.9': + resolution: {integrity: sha512-ryERPIBOnvevAkTq+L1lD+DTFBRcjueL9lOUfXsLfwP92h4e+Heb+PjiqS3/OURWPtywfafK0kj++yDFjWUmrA==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 || ^6.0.0 @@ -1544,20 +1544,20 @@ packages: vite: optional: true - '@vitest/pretty-format@3.0.8': - resolution: {integrity: sha512-BNqwbEyitFhzYMYHUVbIvepOyeQOSFA/NeJMIP9enMntkkxLgOcgABH6fjyXG85ipTgvero6noreavGIqfJcIg==} + '@vitest/pretty-format@3.0.9': + resolution: {integrity: sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==} - '@vitest/runner@3.0.8': - resolution: {integrity: sha512-c7UUw6gEcOzI8fih+uaAXS5DwjlBaCJUo7KJ4VvJcjL95+DSR1kova2hFuRt3w41KZEFcOEiq098KkyrjXeM5w==} + '@vitest/runner@3.0.9': + resolution: {integrity: sha512-NX9oUXgF9HPfJSwl8tUZCMP1oGx2+Sf+ru6d05QjzQz4OwWg0psEzwY6VexP2tTHWdOkhKHUIZH+fS6nA7jfOw==} - '@vitest/snapshot@3.0.8': - resolution: {integrity: sha512-x8IlMGSEMugakInj44nUrLSILh/zy1f2/BgH0UeHpNyOocG18M9CWVIFBaXPt8TrqVZWmcPjwfG/ht5tnpba8A==} + '@vitest/snapshot@3.0.9': + resolution: {integrity: sha512-AiLUiuZ0FuA+/8i19mTYd+re5jqjEc2jZbgJ2up0VY0Ddyyxg/uUtBDpIFAy4uzKaQxOW8gMgBdAJJ2ydhu39A==} - '@vitest/spy@3.0.8': - resolution: {integrity: sha512-MR+PzJa+22vFKYb934CejhR4BeRpMSoxkvNoDit68GQxRLSf11aT6CTj3XaqUU9rxgWJFnqicN/wxw6yBRkI1Q==} + '@vitest/spy@3.0.9': + resolution: {integrity: sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==} - '@vitest/utils@3.0.8': - resolution: {integrity: sha512-nkBC3aEhfX2PdtQI/QwAWp8qZWwzASsU4Npbcd5RdMPBSSLCpkZp52P3xku3s3uA0HIEhGvEcF8rNkBsz9dQ4Q==} + '@vitest/utils@3.0.9': + resolution: {integrity: sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==} abbrev@2.0.0: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} @@ -1776,8 +1776,8 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001705: - resolution: {integrity: sha512-S0uyMMiYvA7CxNgomYBwwwPUnWzFD83f3B1ce5jHUfHTH//QL6hHsreI8RVC5606R4ssqravelYO5TU6t8sEyg==} + caniuse-lite@1.0.30001706: + resolution: {integrity: sha512-3ZczoTApMAZwPKYWmwVbQMFpXBDds3/0VciVoUwPUbldlYyVLmRVuRs/PcUZtHpbLRpzzDvrvnFuREsGt6lUug==} chai@5.2.0: resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} @@ -2102,11 +2102,11 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - effect@3.13.11: - resolution: {integrity: sha512-SOUwX2E1ciNDPZDbSfx+YszGfIIg90sluKyx0BB6VwLIt8+NOA6tEAR3N2XI9MEOWfO/EpWzbARLnXI2hXcvaQ==} + effect@3.13.12: + resolution: {integrity: sha512-XHvZA8lOX7vxk+ME3Q+4BN6EVYsyo8csdHmHsD4oYEtWPb2Ou3WPkpavlHOD+DNap8QIwfZjmDtshcGlgV34hA==} - electron-to-chromium@1.5.119: - resolution: {integrity: sha512-Ku4NMzUjz3e3Vweh7PhApPrZSS4fyiCIbcIrG9eKrriYVLmbMepETR/v6SU7xPm98QTqMSYiCwfO89QNjXLkbQ==} + electron-to-chromium@1.5.120: + resolution: {integrity: sha512-oTUp3gfX1gZI+xfD2djr2rzQdHCwHzPQrrK0CD7WpTdF0nPdQ/INcRVjWgLdCT4a9W3jFObR9DAfsuyFQnI8CQ==} emoji-regex@10.4.0: resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} @@ -3731,8 +3731,8 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.35.0: - resolution: {integrity: sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==} + rollup@4.36.0: + resolution: {integrity: sha512-zwATAXNQxUcd40zgtQG0ZafcRK4g004WtEl7kbuhTWPvf07PsfohXl39jVUvPF7jvNAIkKPQ2XrsDlWuxBd++Q==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -4223,8 +4223,8 @@ packages: resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} engines: {node: '>=12'} - universal-github-app-jwt@2.2.0: - resolution: {integrity: sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ==} + universal-github-app-jwt@2.2.2: + resolution: {integrity: sha512-dcmbeSrOdTnsjGjUfAlqNDJrhxXizjAz94ija9Qw8YkZ1uu0d+GoZzyH+Jb9tIIqvGsadUfwg+22k5aDqqwzbw==} universal-user-agent@6.0.1: resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} @@ -4279,8 +4279,8 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - vite-node@3.0.8: - resolution: {integrity: sha512-6PhR4H9VGlcwXZ+KWCdMqbtG649xCPZqfI9j2PsK1FcXgEzro5bGHcVKFCTqPLaNKZES8Evqv4LwvZARsq5qlg==} + vite-node@3.0.9: + resolution: {integrity: sha512-w3Gdx7jDcuT9cNn9jExXgOyKmf5UOTb6WMHz8LGAm54eS1Elf5OuBhCxl6zJxGhEeIkgsE1WbHuoL0mj/UXqXg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -4324,16 +4324,16 @@ packages: yaml: optional: true - vitest@3.0.8: - resolution: {integrity: sha512-dfqAsNqRGUc8hB9OVR2P0w8PZPEckti2+5rdZip0WIz9WW0MnImJ8XiR61QhqLa92EQzKP2uPkzenKOAHyEIbA==} + vitest@3.0.9: + resolution: {integrity: sha512-BbcFDqNyBlfSpATmTtXOAOj71RNKDDvjBM/uPfnxxVGrG+FSH2RQIwgeEngTaTkuU/h0ScFvf+tRcKfYXzBybQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.0.8 - '@vitest/ui': 3.0.8 + '@vitest/browser': 3.0.9 + '@vitest/ui': 3.0.9 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -5048,9 +5048,9 @@ snapshots: enabled: 2.0.0 kuler: 2.0.0 - '@effect/schema@0.75.5(effect@3.13.11)': + '@effect/schema@0.75.5(effect@3.13.12)': dependencies: - effect: 3.13.11 + effect: 3.13.12 fast-check: 3.23.2 '@esbuild/aix-ppc64@0.25.1': @@ -5695,7 +5695,7 @@ snapshots: '@octokit/request-error': 6.1.7 '@octokit/types': 13.8.0 toad-cache: 3.7.0 - universal-github-app-jwt: 2.2.0 + universal-github-app-jwt: 2.2.2 universal-user-agent: 7.0.2 '@octokit/auth-oauth-app@8.1.3': @@ -5890,61 +5890,61 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.35.0': + '@rollup/rollup-android-arm-eabi@4.36.0': optional: true - '@rollup/rollup-android-arm64@4.35.0': + '@rollup/rollup-android-arm64@4.36.0': optional: true - '@rollup/rollup-darwin-arm64@4.35.0': + '@rollup/rollup-darwin-arm64@4.36.0': optional: true - '@rollup/rollup-darwin-x64@4.35.0': + '@rollup/rollup-darwin-x64@4.36.0': optional: true - '@rollup/rollup-freebsd-arm64@4.35.0': + '@rollup/rollup-freebsd-arm64@4.36.0': optional: true - '@rollup/rollup-freebsd-x64@4.35.0': + '@rollup/rollup-freebsd-x64@4.36.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.35.0': + '@rollup/rollup-linux-arm-gnueabihf@4.36.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.35.0': + '@rollup/rollup-linux-arm-musleabihf@4.36.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.35.0': + '@rollup/rollup-linux-arm64-gnu@4.36.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.35.0': + '@rollup/rollup-linux-arm64-musl@4.36.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.35.0': + '@rollup/rollup-linux-loongarch64-gnu@4.36.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.36.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.35.0': + '@rollup/rollup-linux-riscv64-gnu@4.36.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.35.0': + '@rollup/rollup-linux-s390x-gnu@4.36.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.35.0': + '@rollup/rollup-linux-x64-gnu@4.36.0': optional: true - '@rollup/rollup-linux-x64-musl@4.35.0': + '@rollup/rollup-linux-x64-musl@4.36.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.35.0': + '@rollup/rollup-win32-arm64-msvc@4.36.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.35.0': + '@rollup/rollup-win32-ia32-msvc@4.36.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.35.0': + '@rollup/rollup-win32-x64-msvc@4.36.0': optional: true '@rtsao/scc@1.1.0': {} @@ -6452,43 +6452,43 @@ snapshots: dependencies: '@typespec/compiler': 0.66.0(@types/node@22.5.5) - '@vitest/expect@3.0.8': + '@vitest/expect@3.0.9': dependencies: - '@vitest/spy': 3.0.8 - '@vitest/utils': 3.0.8 + '@vitest/spy': 3.0.9 + '@vitest/utils': 3.0.9 chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0))': + '@vitest/mocker@3.0.9(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0))': dependencies: - '@vitest/spy': 3.0.8 + '@vitest/spy': 3.0.9 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) - '@vitest/pretty-format@3.0.8': + '@vitest/pretty-format@3.0.9': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.0.8': + '@vitest/runner@3.0.9': dependencies: - '@vitest/utils': 3.0.8 + '@vitest/utils': 3.0.9 pathe: 2.0.3 - '@vitest/snapshot@3.0.8': + '@vitest/snapshot@3.0.9': dependencies: - '@vitest/pretty-format': 3.0.8 + '@vitest/pretty-format': 3.0.9 magic-string: 0.30.17 pathe: 2.0.3 - '@vitest/spy@3.0.8': + '@vitest/spy@3.0.9': dependencies: tinyspy: 3.0.2 - '@vitest/utils@3.0.8': + '@vitest/utils@3.0.9': dependencies: - '@vitest/pretty-format': 3.0.8 + '@vitest/pretty-format': 3.0.9 loupe: 3.1.3 tinyrainbow: 2.0.0 @@ -6674,8 +6674,8 @@ snapshots: browserslist@4.24.4: dependencies: - caniuse-lite: 1.0.30001705 - electron-to-chromium: 1.5.119 + caniuse-lite: 1.0.30001706 + electron-to-chromium: 1.5.120 node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.24.4) @@ -6756,7 +6756,7 @@ snapshots: callsites@3.1.0: {} - caniuse-lite@1.0.30001705: {} + caniuse-lite@1.0.30001706: {} chai@5.2.0: dependencies: @@ -7125,12 +7125,12 @@ snapshots: ee-first@1.1.1: {} - effect@3.13.11: + effect@3.13.12: dependencies: '@standard-schema/spec': 1.0.0 fast-check: 3.23.2 - electron-to-chromium@1.5.119: {} + electron-to-chromium@1.5.120: {} emoji-regex@10.4.0: {} @@ -8990,29 +8990,29 @@ snapshots: glob: 11.0.1 package-json-from-dist: 1.0.1 - rollup@4.35.0: + rollup@4.36.0: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.35.0 - '@rollup/rollup-android-arm64': 4.35.0 - '@rollup/rollup-darwin-arm64': 4.35.0 - '@rollup/rollup-darwin-x64': 4.35.0 - '@rollup/rollup-freebsd-arm64': 4.35.0 - '@rollup/rollup-freebsd-x64': 4.35.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.35.0 - '@rollup/rollup-linux-arm-musleabihf': 4.35.0 - '@rollup/rollup-linux-arm64-gnu': 4.35.0 - '@rollup/rollup-linux-arm64-musl': 4.35.0 - '@rollup/rollup-linux-loongarch64-gnu': 4.35.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.35.0 - '@rollup/rollup-linux-riscv64-gnu': 4.35.0 - '@rollup/rollup-linux-s390x-gnu': 4.35.0 - '@rollup/rollup-linux-x64-gnu': 4.35.0 - '@rollup/rollup-linux-x64-musl': 4.35.0 - '@rollup/rollup-win32-arm64-msvc': 4.35.0 - '@rollup/rollup-win32-ia32-msvc': 4.35.0 - '@rollup/rollup-win32-x64-msvc': 4.35.0 + '@rollup/rollup-android-arm-eabi': 4.36.0 + '@rollup/rollup-android-arm64': 4.36.0 + '@rollup/rollup-darwin-arm64': 4.36.0 + '@rollup/rollup-darwin-x64': 4.36.0 + '@rollup/rollup-freebsd-arm64': 4.36.0 + '@rollup/rollup-freebsd-x64': 4.36.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.36.0 + '@rollup/rollup-linux-arm-musleabihf': 4.36.0 + '@rollup/rollup-linux-arm64-gnu': 4.36.0 + '@rollup/rollup-linux-arm64-musl': 4.36.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.36.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.36.0 + '@rollup/rollup-linux-riscv64-gnu': 4.36.0 + '@rollup/rollup-linux-s390x-gnu': 4.36.0 + '@rollup/rollup-linux-x64-gnu': 4.36.0 + '@rollup/rollup-linux-x64-musl': 4.36.0 + '@rollup/rollup-win32-arm64-msvc': 4.36.0 + '@rollup/rollup-win32-ia32-msvc': 4.36.0 + '@rollup/rollup-win32-x64-msvc': 4.36.0 fsevents: 2.3.3 run-parallel@1.2.0: @@ -9323,12 +9323,12 @@ snapshots: syncpack@13.0.3(typescript@5.6.3): dependencies: - '@effect/schema': 0.75.5(effect@3.13.11) + '@effect/schema': 0.75.5(effect@3.13.12) chalk: 5.4.1 chalk-template: 1.1.0 commander: 13.1.0 cosmiconfig: 9.0.0(typescript@5.6.3) - effect: 3.13.11 + effect: 3.13.12 enquirer: 2.4.1 fast-check: 3.23.2 globby: 14.1.0 @@ -9573,7 +9573,7 @@ snapshots: dependencies: crypto-random-string: 4.0.0 - universal-github-app-jwt@2.2.0: {} + universal-github-app-jwt@2.2.2: {} universal-user-agent@6.0.1: {} @@ -9616,7 +9616,7 @@ snapshots: vary@1.1.2: {} - vite-node@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): + vite-node@3.0.9(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: cac: 6.7.14 debug: 4.4.0 @@ -9641,22 +9641,22 @@ snapshots: dependencies: esbuild: 0.25.1 postcss: 8.5.3 - rollup: 4.35.0 + rollup: 4.36.0 optionalDependencies: '@types/node': 22.5.5 fsevents: 2.3.3 tsx: 4.19.3 yaml: 2.7.0 - vitest@3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): + vitest@3.0.9(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0): dependencies: - '@vitest/expect': 3.0.8 - '@vitest/mocker': 3.0.8(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0)) - '@vitest/pretty-format': 3.0.8 - '@vitest/runner': 3.0.8 - '@vitest/snapshot': 3.0.8 - '@vitest/spy': 3.0.8 - '@vitest/utils': 3.0.8 + '@vitest/expect': 3.0.9 + '@vitest/mocker': 3.0.9(vite@6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0)) + '@vitest/pretty-format': 3.0.9 + '@vitest/runner': 3.0.9 + '@vitest/snapshot': 3.0.9 + '@vitest/spy': 3.0.9 + '@vitest/utils': 3.0.9 chai: 5.2.0 debug: 4.4.0 expect-type: 1.2.0 @@ -9668,7 +9668,7 @@ snapshots: tinypool: 1.0.2 tinyrainbow: 2.0.0 vite: 6.2.2(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) - vite-node: 3.0.8(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) + vite-node: 3.0.9(@types/node@22.5.5)(tsx@4.19.3)(yaml@2.7.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.5.5 From 512b22b912899332fc1d480b32cb12947a699e56 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 21 Mar 2025 11:11:05 +0800 Subject: [PATCH 08/13] update --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 50726074f12..9a3960aa409 100644 --- a/package.json +++ b/package.json @@ -33,18 +33,18 @@ "devDependencies": { "@actions/github": "6.0.0", "@chronus/chronus": "^0.12.1", - "@chronus/github": "^0.4.9", - "@eslint/js": "^9.22.0", + "@chronus/github": "^0.4.4", + "@eslint/js": "^9.11.1", "autorest": "~3.7.1", "cross-env": "^7.0.3", - "cspell": "^7.3.9", - "eslint": "^9.22.0", - "eslint-plugin-import": "^2.31.0", + "eslint": "^9.11.1", + "eslint-plugin-import": "^2.30.0", "eslint-plugin-unicorn": "^55.0.0", "prettier": "~3.3.3", - "syncpack": "^13.0.3", - "typescript": "~5.6.3", - "typescript-eslint": "^8.26.1" + "syncpack": "^13.0.0", + "typescript": "~5.6.2", + "typescript-eslint": "^8.7.0", + "cspell": "^7.0.0" }, "syncpack": { "dependencyTypes": [ From 53b371d06b0f4a809c898e3f0b4c742ce2dd8340 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 21 Mar 2025 03:15:15 +0000 Subject: [PATCH 09/13] Update dependencies (2025-03-21 03:15:15) --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 4 ++-- pnpm-lock.yaml | 17 +++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 269c4fc3038..1389a329263 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "~0.8.1", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} +} \ No newline at end of file diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index ea0762d84f8..e5a9b5b0f8c 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.8.1", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -89,4 +89,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e1f3b2a59e..df9d8d820fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.8.1 - version: 0.8.1(xyfohv7glp6msr4ipudj2mb5ju) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(xyfohv7glp6msr4ipudj2mb5ju) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.8.1 - version: 0.8.1(z4b5mqrksjtjtkrtw4eaa2rjea) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1535,8 +1535,9 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@0.8.1': - resolution: {integrity: sha512-OeSO54sFSfR6/Gkny0S3UJTHrXYwfRcaMJf94uBnTUgo5r9QZSBj2BXjNfW4opOvyZ3S7m5ozRQVp9LAMz8suQ==} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} + version: 0.8.1 engines: {node: '>=18.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.53.0 <1.0.0' @@ -6143,7 +6144,7 @@ snapshots: dependencies: '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http-client-python@0.8.1(xyfohv7glp6msr4ipudj2mb5ju)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(xyfohv7glp6msr4ipudj2mb5ju)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(nzqsibdudqbld3r7bpinzdupvm) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) @@ -6164,7 +6165,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.8.1(z4b5mqrksjtjtkrtw4eaa2rjea)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(vsru7ipd7qt42slknz5aanwsou) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) From 823da839dba1cce34ff13a4384856616a1477232 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 21 Mar 2025 03:19:35 +0000 Subject: [PATCH 10/13] Regenerate for typespec-python (2025-03-21 03:19:35) --- .../azure-encode-duration/MANIFEST.in | 2 +- .../generated/azure-encode-duration/README.md | 4 +- .../bytes/aio/operations/_operations.py | 1546 -------------- .../encode/bytes/operations/_operations.py | 1830 ----------------- .../requestbody/aio/operations/_operations.py | 8 +- .../requestbody/operations/_operations.py | 12 +- .../aio/operations/_operations.py | 27 +- .../responsebody/operations/_operations.py | 29 +- .../query/operations/_operations.py | 81 +- .../generated/streaming-jsonl/MANIFEST.in | 2 +- .../azure/generated/streaming-jsonl/README.md | 4 +- .../streaming/jsonl/_client.py | 2 +- .../streaming/jsonl/aio/_client.py | 2 +- .../streaming/jsonl/basic/__init__.py | 1 + .../streaming/jsonl/basic/aio/__init__.py | 1 + .../{ => basic}/aio/operations/__init__.py | 0 .../{ => basic}/aio/operations/_operations.py | 4 +- .../{ => basic}/aio/operations/_patch.py | 0 .../jsonl/{ => basic}/operations/__init__.py | 0 .../{ => basic}/operations/_operations.py | 4 +- .../jsonl/{ => basic}/operations/_patch.py | 0 .../union/aio/operations/_operations.py | 100 +- .../typetest/union/models/_models.py | 108 +- .../typetest/union/operations/_operations.py | 100 +- .../generated/streaming-jsonl/MANIFEST.in | 2 +- .../union/aio/operations/_operations.py | 100 +- .../typetest/union/models/_models.py | 108 +- .../typetest/union/operations/_operations.py | 100 +- 28 files changed, 364 insertions(+), 3813 deletions(-) delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/__init__.py rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/aio/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/aio/operations/_operations.py (98%) rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/aio/operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/operations/_operations.py (98%) rename packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/{ => basic}/operations/_patch.py (100%) diff --git a/packages/typespec-python/test/azure/generated/azure-encode-duration/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-encode-duration/MANIFEST.in index d3512263cc7..863d0757e13 100644 --- a/packages/typespec-python/test/azure/generated/azure-encode-duration/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-encode-duration/MANIFEST.in @@ -5,4 +5,4 @@ recursive-include tests *.py recursive-include samples *.py *.md include specs/__init__.py include specs/azure/__init__.py -include specs/azure/encode/__init__.py \ No newline at end of file +include specs/azure/encode/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-encode-duration/README.md b/packages/typespec-python/test/azure/generated/azure-encode-duration/README.md index 59b9ef07693..fd039aca147 100644 --- a/packages/typespec-python/test/azure/generated/azure-encode-duration/README.md +++ b/packages/typespec-python/test/azure/generated/azure-encode-duration/README.md @@ -1,5 +1,3 @@ - - # Specs Azure Encode Duration client library for Python @@ -17,6 +15,7 @@ python -m pip install specs-azure-encode-duration - You need an [Azure subscription][azure_sub] to use this package. - An existing Specs Azure Encode Duration instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py deleted file mode 100644 index e84915c1d29..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py +++ /dev/null @@ -1,1546 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize -from ..._serialization import Deserializer, Serializer -from ...operations._operations import ( - build_header_base64_request, - build_header_base64_url_array_request, - build_header_base64_url_request, - build_header_default_request, - build_property_base64_request, - build_property_base64_url_array_request, - build_property_base64_url_request, - build_property_default_request, - build_query_base64_request, - build_query_base64_url_array_request, - build_query_base64_url_request, - build_query_default_request, - build_request_body_base64_request, - build_request_body_base64_url_request, - build_request_body_custom_content_type_request, - build_request_body_default_request, - build_request_body_octet_stream_request, - build_response_body_base64_request, - build_response_body_base64_url_request, - build_response_body_custom_content_type_request, - build_response_body_default_request, - build_response_body_octet_stream_request, -) -from .._configuration import BytesClientConfiguration - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: bytes, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, *, value: bytes, **kwargs: Any) -> None: - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PropertyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`property` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: ~encode.bytes.models.DefaultBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def default( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def default( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: ~encode.bytes.models.Base64BytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url_array( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def base64_url_array( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] - Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_array_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, *, value: bytes, **kwargs: Any) -> None: - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, *, value: bytes, **kwargs: Any) -> None: - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, *, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url_array(self, *, value: List[bytes], **kwargs: Any) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RequestBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`request_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, value: bytes, **kwargs: Any) -> None: - """default. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def octet_stream(self, value: bytes, **kwargs: Any) -> None: - """octet_stream. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_octet_stream_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def custom_content_type(self, value: bytes, **kwargs: Any) -> None: - """custom_content_type. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_custom_content_type_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64(self, value: bytes, **kwargs: Any) -> None: - """base64. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def base64_url(self, value: bytes, **kwargs: Any) -> None: - """base64_url. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore - - _request = build_request_body_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.aio.BytesClient`'s - :attr:`response_body` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def default(self, **kwargs: Any) -> AsyncIterator[bytes]: - """default. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def octet_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: - """octet_stream. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_octet_stream_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def custom_content_type(self, **kwargs: Any) -> AsyncIterator[bytes]: - """custom_content_type. - - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_custom_content_type_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def base64(self, **kwargs: Any) -> bytes: - """base64. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def base64_url(self, **kwargs: Any) -> bytes: - """base64_url. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_url_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py deleted file mode 100644 index 51afaca22b0..00000000000 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py +++ /dev/null @@ -1,1830 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import json -import sys -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from .._configuration import BytesClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Deserializer, Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_query_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/default" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64url" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "base64") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_query_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/encode/bytes/query/base64url-array" - - # Construct parameters - _params["value"] = _SERIALIZER.query("value", value, "[base64]", div=",") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_property_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/default" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64url" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_base64_url_array_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/property/base64url-array" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_header_default_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/default" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "bytearray") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_url_request(*, value: bytes, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64url" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "base64") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_header_base64_url_array_request(*, value: List[bytes], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/encode/bytes/header/base64url-array" - - # Construct headers - _headers["value"] = _SERIALIZER.header("value", value, "[base64]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_request_body_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/default" - - # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_octet_stream_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/octet-stream" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/custom-content-type" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/base64" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_request_body_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: str = kwargs.pop("content_type") - # Construct URL - _url = "/encode/bytes/body/request/base64url" - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_response_body_default_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/octet-stream") - - # Construct URL - _url = "/encode/bytes/body/response/default" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_octet_stream_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/octet-stream") - - # Construct URL - _url = "/encode/bytes/body/response/octet-stream" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_custom_content_type_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "image/png") - - # Construct URL - _url = "/encode/bytes/body/response/custom-content-type" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_base64_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/body/response/base64" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -def build_response_body_base64_url_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/bytes/body/response/base64url" - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - -class QueryOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`query` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[bytes], **kwargs: Any - ) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_query_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class PropertyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`property` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def default( - self, body: _models.DefaultBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: ~encode.bytes.models.DefaultBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def default( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def default( - self, body: Union[_models.DefaultBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.DefaultBytesProperty: - """default. - - :param body: Is one of the following types: DefaultBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.DefaultBytesProperty or JSON or IO[bytes] - :return: DefaultBytesProperty. The DefaultBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.DefaultBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefaultBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DefaultBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64( - self, body: _models.Base64BytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: ~encode.bytes.models.Base64BytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64( - self, body: Union[_models.Base64BytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64BytesProperty: - """base64. - - :param body: Is one of the following types: Base64BytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64BytesProperty or JSON or IO[bytes] - :return: Base64BytesProperty. The Base64BytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64BytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64BytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64BytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64_url( - self, body: _models.Base64urlBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64_url( - self, body: Union[_models.Base64urlBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlBytesProperty: - """base64_url. - - :param body: Is one of the following types: Base64urlBytesProperty, JSON, IO[bytes] Required. - :type body: ~encode.bytes.models.Base64urlBytesProperty or JSON or IO[bytes] - :return: Base64urlBytesProperty. The Base64urlBytesProperty is compatible with MutableMapping - :rtype: ~encode.bytes.models.Base64urlBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def base64_url_array( - self, body: _models.Base64urlArrayBytesProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url_array( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def base64_url_array( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def base64_url_array( - self, body: Union[_models.Base64urlArrayBytesProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Base64urlArrayBytesProperty: - """base64_url_array. - - :param body: Is one of the following types: Base64urlArrayBytesProperty, JSON, IO[bytes] - Required. - :type body: ~encode.bytes.models.Base64urlArrayBytesProperty or JSON or IO[bytes] - :return: Base64urlArrayBytesProperty. The Base64urlArrayBytesProperty is compatible with - MutableMapping - :rtype: ~encode.bytes.models.Base64urlArrayBytesProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Base64urlArrayBytesProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_base64_url_array_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Base64urlArrayBytesProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_default_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :keyword value: Required. - :paramtype value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url_array( # pylint: disable=inconsistent-return-statements - self, *, value: List[bytes], **kwargs: Any - ) -> None: - """base64_url_array. - - :keyword value: Required. - :paramtype value: list[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_base64_url_array_request( - value=value, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RequestBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`request_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """default. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_default_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """octet_stream. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_octet_stream_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def custom_content_type( # pylint: disable=inconsistent-return-statements - self, value: bytes, **kwargs: Any - ) -> None: - """custom_content_type. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "image/png")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = value - - _request = build_request_body_custom_content_type_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore - - _request = build_request_body_base64_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def base64_url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """base64_url. - - :param value: Required. - :type value: bytes - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore - - _request = build_request_body_base64_url_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ResponseBodyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~encode.bytes.BytesClient`'s - :attr:`response_body` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: BytesClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def default(self, **kwargs: Any) -> Iterator[bytes]: - """default. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_default_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def octet_stream(self, **kwargs: Any) -> Iterator[bytes]: - """octet_stream. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_octet_stream_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def custom_content_type(self, **kwargs: Any) -> Iterator[bytes]: - """custom_content_type. - - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_response_body_custom_content_type_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def base64(self, **kwargs: Any) -> bytes: - """base64. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def base64_url(self, **kwargs: Any) -> bytes: - """base64_url. - - :return: bytes - :rtype: bytes - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[bytes] = kwargs.pop("cls", None) - - _request = build_response_body_base64_url_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py index ed6160b520b..6d312998c80 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/aio/operations/_operations.py @@ -80,10 +80,10 @@ async def default(self, value: bytes, **kwargs: Any) -> None: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) cls: ClsType[None] = kwargs.pop("cls", None) - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + _content = value _request = build_request_body_default_request( content_type=content_type, @@ -233,7 +233,7 @@ async def base64(self, value: bytes, **kwargs: Any) -> None: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[None] = kwargs.pop("cls", None) _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore @@ -284,7 +284,7 @@ async def base64_url(self, value: bytes, **kwargs: Any) -> None: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[None] = kwargs.pop("cls", None) _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py index 02b7e379940..7ea809f3b60 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/requestbody/operations/_operations.py @@ -85,7 +85,7 @@ def build_request_body_base64_request(**kwargs: Any) -> HttpRequest: _url = "/encode/bytes/body/request/base64" # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) @@ -98,7 +98,7 @@ def build_request_body_base64_url_request(**kwargs: Any) -> HttpRequest: _url = "/encode/bytes/body/request/base64url" # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) @@ -141,10 +141,10 @@ def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/octet-stream")) cls: ClsType[None] = kwargs.pop("cls", None) - _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore + _content = value _request = build_request_body_default_request( content_type=content_type, @@ -296,7 +296,7 @@ def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incons _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[None] = kwargs.pop("cls", None) _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64") # type: ignore @@ -347,7 +347,7 @@ def base64_url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=in _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[None] = kwargs.pop("cls", None) _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True, format="base64url") # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py index 8b8c2bc4eff..0654fef00ba 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py @@ -60,11 +60,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def default(self, **kwargs: Any) -> bytes: + async def default(self, **kwargs: Any) -> AsyncIterator[bytes]: """default. - :return: bytes - :rtype: bytes + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -78,7 +78,7 @@ async def default(self, **kwargs: Any) -> bytes: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[bytes] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_response_body_default_request( headers=_headers, @@ -89,7 +89,7 @@ async def default(self, **kwargs: Any) -> bytes: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -105,10 +105,7 @@ async def default(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -273,13 +270,16 @@ async def base64(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -329,12 +329,15 @@ async def base64_url(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64url") + deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py index 7ab897fa50f..7d36a54df63 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py @@ -42,7 +42,7 @@ def build_response_body_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - accept = _headers.pop("Accept", "application/json") + accept = _headers.pop("Accept", "application/octet-stream") # Construct URL _url = "/encode/bytes/body/response/default" @@ -127,11 +127,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def default(self, **kwargs: Any) -> bytes: + def default(self, **kwargs: Any) -> Iterator[bytes]: """default. - :return: bytes - :rtype: bytes + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -145,7 +145,7 @@ def default(self, **kwargs: Any) -> bytes: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[bytes] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_response_body_default_request( headers=_headers, @@ -156,7 +156,7 @@ def default(self, **kwargs: Any) -> bytes: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -172,10 +172,7 @@ def default(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = response.iter_bytes() if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -340,13 +337,16 @@ def base64(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -396,12 +396,15 @@ def base64_url(self, **kwargs: Any) -> bytes: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64url") + deserialized = _deserialize(bytes, response.json(), format="base64") if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py index acc529a3411..4abda2c6b78 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/query/operations/_operations.py @@ -22,8 +22,8 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .._configuration import CollectionFormatClientConfiguration -from .._serialization import Deserializer, Serializer +from ..._configuration import CollectionFormatClientConfiguration +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -84,18 +84,6 @@ def build_query_csv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, **kwargs) -def build_header_csv_request(*, colors: List[str], **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - # Construct URL - _url = "/parameters/collection-format/header/csv" - - # Construct headers - _headers["colors"] = _SERIALIZER.header("colors", colors, "[str]", div=",") - - return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) - - class QueryOperations: """ .. warning:: @@ -300,68 +288,3 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i if cls: return cls(pipeline_response, None, {}) # type: ignore - - -class HeaderOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~parameters.collectionformat.CollectionFormatClient`'s - :attr:`header` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CollectionFormatClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """csv. - - :keyword colors: Possible values for colors are [blue,red,green]. Required. - :paramtype colors: list[str] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_header_csv_request( - colors=colors, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/MANIFEST.in b/packages/typespec-python/test/azure/generated/streaming-jsonl/MANIFEST.in index 0535e9d52c8..32a6518ac7e 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include streaming/jsonl/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include streaming/__init__.py \ No newline at end of file +include streaming/__init__.py diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/README.md b/packages/typespec-python/test/azure/generated/streaming-jsonl/README.md index 5bf164c3cfa..8004a637f08 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/README.md +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/README.md @@ -1,5 +1,3 @@ - - # Streaming Jsonl client library for Python @@ -17,6 +15,7 @@ python -m pip install streaming-jsonl - You need an [Azure subscription][azure_sub] to use this package. - An existing Streaming Jsonl instance. + ## Contributing This project welcomes contributions and suggestions. Most contributions require @@ -42,4 +41,3 @@ additional questions or comments. [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential [pip]: https://pypi.org/project/pip/ [azure_sub]: https://azure.microsoft.com/free/ - diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/_client.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/_client.py index 568e6702876..5f4503ae008 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/_client.py +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/_client.py @@ -16,7 +16,7 @@ from ._configuration import JsonlClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import BasicOperations +from .basic.operations import BasicOperations class JsonlClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/_client.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/_client.py index c4c7bbd07c1..ccb855c2ff9 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/_client.py @@ -15,8 +15,8 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer +from ..basic.aio.operations import BasicOperations from ._configuration import JsonlClientConfiguration -from .operations import BasicOperations class JsonlClient: # pylint: disable=client-accepts-api-version-keyword diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/__init__.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/__init__.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/__init__.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/_operations.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/_operations.py index 5cd53de149e..c3164171232 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/_operations.py @@ -24,9 +24,9 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ..._serialization import Deserializer, Serializer +from ...._serialization import Deserializer, Serializer +from ....aio._configuration import JsonlClientConfiguration from ...operations._operations import build_basic_receive_request, build_basic_send_request -from .._configuration import JsonlClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/aio/operations/_patch.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/aio/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/__init__.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/__init__.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/_operations.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/_operations.py similarity index 98% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/_operations.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/_operations.py index eb9bd83cd1b..e1214d80140 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/_operations.py @@ -24,8 +24,8 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .._configuration import JsonlClientConfiguration -from .._serialization import Deserializer, Serializer +from ..._configuration import JsonlClientConfiguration +from ..._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/_patch.py b/packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/operations/_patch.py rename to packages/typespec-python/test/azure/generated/streaming-jsonl/streaming/jsonl/basic/operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py index 4ff35e49dc4..974dc9d1b10 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -82,11 +82,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -100,7 +100,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -130,7 +130,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -267,11 +267,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -285,7 +285,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -315,7 +315,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -454,11 +454,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -472,7 +472,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -502,7 +502,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -645,11 +645,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -663,7 +663,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -693,7 +693,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -826,11 +826,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -844,7 +844,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -874,7 +874,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1005,11 +1005,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1023,7 +1023,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1053,7 +1053,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1188,11 +1188,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1206,7 +1206,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1236,7 +1236,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1371,11 +1371,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1389,7 +1389,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1419,7 +1419,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1554,11 +1554,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1572,7 +1572,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1602,7 +1602,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1737,11 +1737,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1755,7 +1755,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1785,7 +1785,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py index a635d6561b2..64bf34989d6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py @@ -112,18 +112,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload @@ -140,20 +140,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -170,20 +168,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -200,18 +196,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -228,18 +224,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -256,18 +252,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -284,18 +280,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -312,18 +308,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -340,18 +338,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -368,18 +368,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py index c9d80b640f5..34efe0563d6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py @@ -343,11 +343,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -361,7 +361,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -391,7 +391,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -526,11 +526,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -544,7 +544,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -574,7 +574,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -713,11 +713,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -731,7 +731,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -761,7 +761,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -904,11 +904,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -922,7 +922,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -952,7 +952,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1085,11 +1085,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1103,7 +1103,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1133,7 +1133,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1266,11 +1266,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1284,7 +1284,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1314,7 +1314,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1449,11 +1449,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1467,7 +1467,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1497,7 +1497,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1630,11 +1630,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1648,7 +1648,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1678,7 +1678,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1811,11 +1811,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1829,7 +1829,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1859,7 +1859,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1992,11 +1992,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2010,7 +2010,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -2040,7 +2040,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/streaming-jsonl/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/streaming-jsonl/MANIFEST.in index 0535e9d52c8..32a6518ac7e 100644 --- a/packages/typespec-python/test/unbranded/generated/streaming-jsonl/MANIFEST.in +++ b/packages/typespec-python/test/unbranded/generated/streaming-jsonl/MANIFEST.in @@ -3,4 +3,4 @@ include LICENSE include streaming/jsonl/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include streaming/__init__.py \ No newline at end of file +include streaming/__init__.py diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py index a157ee56b1f..6e4d31c08fc 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -80,11 +80,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -98,7 +98,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -126,7 +126,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -259,11 +259,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -277,7 +277,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -305,7 +305,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -440,11 +440,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -458,7 +458,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -486,7 +486,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -625,11 +625,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -643,7 +643,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -671,7 +671,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -800,11 +800,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -818,7 +818,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -846,7 +846,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -973,11 +973,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -991,7 +991,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1019,7 +1019,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1150,11 +1150,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1168,7 +1168,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1196,7 +1196,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1327,11 +1327,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1345,7 +1345,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1373,7 +1373,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1504,11 +1504,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1522,7 +1522,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1550,7 +1550,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1681,11 +1681,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1699,7 +1699,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1727,7 +1727,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py index bb1f50ee741..a19ab397c1c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py @@ -112,18 +112,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload @@ -140,20 +140,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -170,20 +168,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -200,18 +196,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -228,18 +224,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -256,18 +252,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -284,18 +280,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -312,18 +308,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -340,18 +338,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -368,18 +368,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py index a7d231500f0..7d8f501cedc 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py @@ -341,11 +341,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -359,7 +359,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -387,7 +387,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -518,11 +518,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -536,7 +536,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -564,7 +564,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -699,11 +699,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -717,7 +717,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -745,7 +745,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -884,11 +884,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -902,7 +902,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -930,7 +930,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1059,11 +1059,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1077,7 +1077,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1105,7 +1105,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1234,11 +1234,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1252,7 +1252,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1280,7 +1280,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1411,11 +1411,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1429,7 +1429,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1457,7 +1457,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1586,11 +1586,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1604,7 +1604,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1632,7 +1632,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1761,11 +1761,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1779,7 +1779,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1807,7 +1807,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1936,11 +1936,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1954,7 +1954,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1982,7 +1982,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore From 64f0f2f0149342b5048db9e46fcc6c7db3be11d9 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 24 Mar 2025 03:10:07 +0000 Subject: [PATCH 11/13] Update dependencies (2025-03-24 03:10:07) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 6 +- pnpm-lock.yaml | 82 +++++++++++++-------------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 1389a329263..e465579eb53 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index e5a9b5b0f8c..3af94b7dc70 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -54,13 +54,13 @@ "@azure-tools/typespec-azure-resource-manager": ">=0.53.0 <1.0.0", "@azure-tools/typespec-autorest": ">=0.53.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.53.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.53.0 <1.0.0" + "@azure-tools/typespec-client-generator-core": ">=0.53.1 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -73,7 +73,7 @@ "@azure-tools/typespec-azure-core": "~0.53.0", "@azure-tools/typespec-azure-rulesets": "~0.53.0", "@azure-tools/typespec-autorest": "~0.53.0", - "@azure-tools/typespec-client-generator-core": "~0.53.0", + "@azure-tools/typespec-client-generator-core": "~0.53.1", "@azure-tools/azure-http-specs": "0.1.0-alpha.10", "@typespec/http-specs": "0.1.0-alpha.15-dev.3", "@types/js-yaml": "~4.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df9d8d820fc..6bf80316ae7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(xyfohv7glp6msr4ipudj2mb5ju) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(na5sqrbfiqe26rpjh3d3zww5om) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -99,7 +99,7 @@ importers: version: 0.1.0-alpha.10(hxmxu44wsiwmqbpvyuomrsmujq) '@azure-tools/typespec-autorest': specifier: ~0.53.0 - version: 0.53.0(vsru7ipd7qt42slknz5aanwsou) + version: 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) '@azure-tools/typespec-azure-core': specifier: ~0.53.0 version: 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) @@ -108,10 +108,10 @@ importers: version: 0.53.0(felt6lfzt5orrlwrzxpkykwppa) '@azure-tools/typespec-azure-rulesets': specifier: ~0.53.0 - version: 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.0(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) + version: 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.53.0 - version: 0.53.0(3qm5ewpnxvwkav6ttg6x7temqm) + specifier: ~0.53.1 + version: 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -231,8 +231,8 @@ packages: '@azure-tools/typespec-client-generator-core': ^0.53.0 '@typespec/compiler': ^0.67.0 - '@azure-tools/typespec-client-generator-core@0.53.0': - resolution: {integrity: sha512-EXdkC76HmAdaH0kzET38pPpG7Phoyvp9AFYsAXnQdhRQssfI+x9nxEADix8GZ2n2P1P50ZysvzWeciqgqUbRVw==} + '@azure-tools/typespec-client-generator-core@0.53.1': + resolution: {integrity: sha512-BWHQQ9Kjsk23Rb0eZ6V6HI2Gr20n/LhxAKEuBChCFWLjrFMYyXrHtlUBK6j/9D2VqwjaurRQA2SVXx/wzGyvAg==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.53.0 @@ -1535,16 +1535,16 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} version: 0.8.1 - engines: {node: '>=18.0.0'} + engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.53.0 <1.0.0' '@azure-tools/typespec-azure-core': '>=0.53.0 <1.0.0' '@azure-tools/typespec-azure-resource-manager': '>=0.53.0 <1.0.0' '@azure-tools/typespec-azure-rulesets': '>=0.53.0 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.53.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.53.1 <1.0.0' '@typespec/compiler': '>=0.67.0 <1.0.0' '@typespec/http': '>=0.67.0 <1.0.0' '@typespec/openapi': '>=0.67.0 <1.0.0' @@ -4527,28 +4527,28 @@ snapshots: - debug - supports-color - '@azure-tools/typespec-autorest@0.53.0(nzqsibdudqbld3r7bpinzdupvm)': - dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-client-generator-core': 0.53.0(vvgwrzozbt5d3w3ee557dp5xuy) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - - '@azure-tools/typespec-autorest@0.53.0(vsru7ipd7qt42slknz5aanwsou)': + '@azure-tools/typespec-autorest@0.53.0(e3cfoxkazmlklhsfsyiqwpleoq)': dependencies: '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-client-generator-core': 0.53.0(3qm5ewpnxvwkav6ttg6x7temqm) + '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) '@typespec/compiler': 0.67.1(@types/node@22.5.5) '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@azure-tools/typespec-autorest@0.53.0(wjegnqrrlroq36cedwihs7fwdy)': + dependencies: + '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) + '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) + '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) + '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) + '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) + '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))))': dependencies: '@typespec/compiler': 0.67.1(@types/node@22.13.10) @@ -4583,21 +4583,21 @@ snapshots: change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.0(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10))': dependencies: '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-client-generator-core': 0.53.0(vvgwrzozbt5d3w3ee557dp5xuy) + '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.0(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5))': dependencies: '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-client-generator-core': 0.53.0(3qm5ewpnxvwkav6ttg6x7temqm) + '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@azure-tools/typespec-client-generator-core@0.53.0(3qm5ewpnxvwkav6ttg6x7temqm)': + '@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm)': dependencies: '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) '@typespec/compiler': 0.67.1(@types/node@22.5.5) @@ -4613,7 +4613,7 @@ snapshots: pluralize: 8.0.0 yaml: 2.7.0 - '@azure-tools/typespec-client-generator-core@0.53.0(vvgwrzozbt5d3w3ee557dp5xuy)': + '@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy)': dependencies: '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) '@typespec/compiler': 0.67.1(@types/node@22.13.10) @@ -6144,13 +6144,13 @@ snapshots: dependencies: '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(xyfohv7glp6msr4ipudj2mb5ju)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(na5sqrbfiqe26rpjh3d3zww5om)': dependencies: - '@azure-tools/typespec-autorest': 0.53.0(nzqsibdudqbld3r7bpinzdupvm) + '@azure-tools/typespec-autorest': 0.53.0(wjegnqrrlroq36cedwihs7fwdy) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.0(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@azure-tools/typespec-client-generator-core': 0.53.0(vvgwrzozbt5d3w3ee557dp5xuy) + '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) '@typespec/compiler': 0.67.1(@types/node@22.13.10) '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) @@ -6165,13 +6165,13 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3NjA2Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu)': dependencies: - '@azure-tools/typespec-autorest': 0.53.0(vsru7ipd7qt42slknz5aanwsou) + '@azure-tools/typespec-autorest': 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.0(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@azure-tools/typespec-client-generator-core': 0.53.0(3qm5ewpnxvwkav6ttg6x7temqm) + '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) '@typespec/compiler': 0.67.1(@types/node@22.5.5) '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) From 2b618cceae7c0633448459a29809ff66b96c614c Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 24 Mar 2025 17:06:08 +0800 Subject: [PATCH 12/13] update --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 4 ++-- pnpm-lock.yaml | 17 ++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index e465579eb53..fbf7e093acc 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@typespec/http-client-python": "~0.9.0-dev.1", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} \ No newline at end of file +} diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 3af94b7dc70..71caf5fd160 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@typespec/http-client-python": "~0.9.0-dev.1", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -89,4 +89,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bf80316ae7..57ae98610f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(na5sqrbfiqe26rpjh3d3zww5om) + specifier: ~0.9.0-dev.1 + version: 0.9.0-dev.1(na5sqrbfiqe26rpjh3d3zww5om) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu) + specifier: ~0.9.0-dev.1 + version: 0.9.0-dev.1(tbepisicnniwwh5yfhvlwsftvu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1535,9 +1535,8 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} - version: 0.8.1 + '@typespec/http-client-python@0.9.0-dev.1': + resolution: {integrity: sha512-Bch/zdt2wol6e4sBHbfruXVexubKfp1oM9jY8GXDGBvXKoSgMVDwVahExrf58JSrMeLFN2rcEL+BH2BTLJCd/w==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.53.0 <1.0.0' @@ -6144,7 +6143,7 @@ snapshots: dependencies: '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(na5sqrbfiqe26rpjh3d3zww5om)': + '@typespec/http-client-python@0.9.0-dev.1(na5sqrbfiqe26rpjh3d3zww5om)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(wjegnqrrlroq36cedwihs7fwdy) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) @@ -6165,7 +6164,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MjY1My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu)': + '@typespec/http-client-python@0.9.0-dev.1(tbepisicnniwwh5yfhvlwsftvu)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) From 01bd9867cf15830fc15245eb5741cb90b59794a1 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 24 Mar 2025 17:07:22 +0800 Subject: [PATCH 13/13] add changelog --- ...o-microsoft-update-root-namespace-2025-2-24-17-7-15.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md diff --git a/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md b/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md new file mode 100644 index 00000000000..9e5e04415f8 --- /dev/null +++ b/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md @@ -0,0 +1,8 @@ +--- +changeKind: feature +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +Always respect namespace from TCGC \ No newline at end of file