From 6fcbffbc051fd510c3364f57eb21cbc1a797d715 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 06:38:16 +0000 Subject: [PATCH 01/24] Update dependencies --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 9aae5578f7..bf5735b08b 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.15.1", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.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 1385a38a65..5fe0e5d0db 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.15.1", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -86,7 +86,7 @@ "@azure-tools/typespec-azure-rulesets": "~0.59.0", "@azure-tools/typespec-autorest": "~0.59.0", "@azure-tools/typespec-client-generator-core": "~0.59.0", - "@azure-tools/azure-http-specs": "0.1.0-alpha.25", + "@azure-tools/azure-http-specs": "0.1.0-alpha.26", "@typespec/http-specs": "0.1.0-alpha.25", "@typespec/spector": "0.1.0-alpha.17", "@typespec/spec-api": "0.1.0-alpha.8", @@ -103,4 +103,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file From 575bcd3cb398bf5a84a2b84120c4f163f017a4d8 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 06:39:15 +0000 Subject: [PATCH 02/24] Update dependencies (2025-08-11 06:39:15) --- pnpm-lock.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9171927061..42b9a0ded4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.15.1 - version: 0.15.1(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.15.1 - version: 0.15.1(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -98,8 +98,8 @@ importers: version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': - specifier: 0.1.0-alpha.25 - version: 0.1.0-alpha.25(tsnbxk7z3h65bhkmgjy2jtqk7m) + specifier: 0.1.0-alpha.26 + version: 0.1.0-alpha.26(tsnbxk7z3h65bhkmgjy2jtqk7m) '@azure-tools/typespec-autorest': specifier: ~0.59.0 version: 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) @@ -209,8 +209,8 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/azure-http-specs@0.1.0-alpha.25': - resolution: {integrity: sha512-fvexvGbDUUcd6su+RCln/hrOosbWYvl1FaycaifX0NVJub/ne492G2dvHLgp2N8rnUJ9uIenXYjHZHYsrjyGHQ==} + '@azure-tools/azure-http-specs@0.1.0-alpha.26': + resolution: {integrity: sha512-GsEQLscGE3K8dFN9P5iOWC4x/hDqNS8qDwzK9cMfIjSodZ3krtJurmjmhhtfyXQvsx0gOo+2xRJ/c56EDfMluw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.59.0 @@ -1677,8 +1677,9 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@0.15.1': - resolution: {integrity: sha512-fYoNQ6NgJNweSa0xRzepRdDsWBWS3Sh9vx3aL9KplX/oismlrsVgMxcQ0mBgUjLOrXVO4Q+jBIG2yujcLjFMeg==} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz} + version: 0.15.1 engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.59.0 <1.0.0' @@ -4865,7 +4866,7 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.25(tsnbxk7z3h65bhkmgjy2jtqk7m)': + '@azure-tools/azure-http-specs@0.1.0-alpha.26(tsnbxk7z3h65bhkmgjy2jtqk7m)': dependencies: '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) '@typespec/compiler': 1.3.0(@types/node@24.1.0) @@ -6459,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@0.15.1(6gtvfxfythggrmyik6oqzxhslm)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm)': dependencies: '@azure-tools/typespec-autorest': 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) From 4392b7c9c07933cc537d782b9e423fa3737c0153 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 06:44:07 +0000 Subject: [PATCH 03/24] Regenerate for typespec-python (2025-08-11 06:44:07) --- .../core/access/models/_models.py | 7 +- .../commonproperties/models/_models.py | 41 ------- .../operationtemplates/models/_models.py | 41 ------- .../resources/models/_models.py | 104 +----------------- .../subdir/_generated/models/_models.py | 2 - .../model/enumdiscriminator/models/_models.py | 10 +- .../nesteddiscriminator/models/_models.py | 24 ++-- .../model/notdiscriminated/models/_models.py | 6 - .../model/recursive/models/_models.py | 2 - .../singlediscriminator/models/_models.py | 25 ++--- .../additionalproperties/models/_models.py | 22 +--- .../subdir/_generated/models/_models.py | 2 - .../model/enumdiscriminator/models/_models.py | 10 +- .../nesteddiscriminator/models/_models.py | 24 ++-- .../model/notdiscriminated/models/_models.py | 6 - .../model/recursive/models/_models.py | 2 - .../singlediscriminator/models/_models.py | 25 ++--- .../additionalproperties/models/_models.py | 22 +--- 18 files changed, 56 insertions(+), 319 deletions(-) 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/models/_models.py index 0d18fba547..fc94065909 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/models/_models.py @@ -196,8 +196,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OuterModel(BaseModel): """Used in internal operations, should be generated but not exported. - :ivar name: Required. - :vartype name: str :ivar inner: Required. :vartype inner: ~specs.azure.clientgenerator.core.access.models._models.InnerModel """ @@ -283,8 +281,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RealModel(AbstractModel, discriminator="real"): """Used in internal operations, should be generated but not exported. - :ivar name: Required. - :vartype name: str :ivar kind: Required. Default value is "real". :vartype kind: str """ @@ -307,7 +303,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="real", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "real" class SharedModel(_Model): diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py index d70afed1b7..7a6d38093e 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py @@ -164,17 +164,6 @@ class Resource(_Model): class TrackedResource(Resource): """Tracked Resource. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -209,21 +198,6 @@ class ConfidentialResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.commonproperties.models.ConfidentialResourceProperties @@ -396,21 +370,6 @@ class ManagedIdentityTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.commonproperties.models.ManagedIdentityTrackedResourceProperties diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py index 3ec1d43d86..db3f48bbd6 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py @@ -474,17 +474,6 @@ class Resource(_Model): class TrackedResource(Resource): """Tracked Resource. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -519,21 +508,6 @@ class Order(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.operationtemplates.models.OrderProperties """ @@ -672,21 +646,6 @@ class Widget(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.operationtemplates.models.WidgetProperties """ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py index 59578127d9..384a3ab05e 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py @@ -118,37 +118,13 @@ class Resource(_Model): class ExtensionResource(Resource): - """The base extension resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData - """ + """The base extension resource.""" class ExtensionsResource(ExtensionResource): """Concrete extension resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.ExtensionsResourceProperties """ @@ -213,37 +189,13 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ProxyResource(Resource): - """Proxy Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData - """ + """Proxy Resource.""" class LocationResource(ProxyResource): """Concrete proxy resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.LocationResourceProperties """ @@ -310,17 +262,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class NestedProxyResource(ProxyResource): """Nested child of Top Level Tracked Resource. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.NestedProxyResourceProperties """ @@ -420,17 +361,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TrackedResource(Resource): """Tracked Resource. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -465,21 +395,6 @@ class SingletonTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.SingletonTrackedResourceProperties """ @@ -616,21 +531,6 @@ class TopLevelTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.resourcemanager.resources.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.TopLevelTrackedResourceProperties """ diff --git a/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py b/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py index 92a359538c..cb1aca3ddd 100644 --- a/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py +++ b/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py @@ -47,8 +47,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. - :ivar extension: - :vartype extension: list[~generation.subdir._generated.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index 609edc2fcc..8ffff82e5d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -54,8 +54,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cobra(Snake, discriminator="cobra"): """Cobra model. - :ivar length: Length of the snake. Required. - :vartype length: int :ivar kind: discriminator property. Required. Species cobra :vartype kind: str or ~typetest.model.enumdiscriminator.models.COBRA """ @@ -78,7 +76,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind=SnakeKind.COBRA, **kwargs) + super().__init__(*args, **kwargs) + self.kind = SnakeKind.COBRA class Dog(_Model): @@ -121,8 +120,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Golden(Dog, discriminator="golden"): """Golden dog model. - :ivar weight: Weight of the dog. Required. - :vartype weight: int :ivar kind: discriminator property. Required. Species golden :vartype kind: str or ~typetest.model.enumdiscriminator.models.GOLDEN """ @@ -145,4 +142,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind=DogKind.GOLDEN, **kwargs) + super().__init__(*args, **kwargs) + self.kind = DogKind.GOLDEN diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index 783273c6eb..958ab47e3e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -60,8 +60,6 @@ class Shark(Fish, discriminator="shark"): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GoblinShark, SawShark - :ivar age: Required. - :vartype age: int :ivar kind: Required. Default value is "shark". :vartype kind: str :ivar sharktype: Required. Default value is None. @@ -90,16 +88,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="shark", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "shark" class GoblinShark(Shark, discriminator="goblin"): """The third level model GoblinShark in polymorphic multiple levels inheritance. - :ivar age: Required. - :vartype age: int - :ivar kind: Required. Default value is "shark". - :vartype kind: str :ivar sharktype: Required. Default value is "goblin". :vartype sharktype: str """ @@ -123,15 +118,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, sharktype="goblin", **kwargs) + super().__init__(*args, **kwargs) + self.sharktype = "goblin" class Salmon(Fish, discriminator="salmon"): """The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances. - :ivar age: Required. - :vartype age: int :ivar kind: Required. Default value is "salmon". :vartype kind: str :ivar friends: @@ -166,16 +160,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="salmon", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "salmon" class SawShark(Shark, discriminator="saw"): """The third level model SawShark in polymorphic multiple levels inheritance. - :ivar age: Required. - :vartype age: int - :ivar kind: Required. Default value is "shark". - :vartype kind: str :ivar sharktype: Required. Default value is "saw". :vartype sharktype: str """ @@ -199,4 +190,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, sharktype="saw", **kwargs) + super().__init__(*args, **kwargs) + self.sharktype = "saw" diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py index be87f1155d..b559473844 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py @@ -43,8 +43,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cat(Pet): """The second level model in the normal multiple levels inheritance. - :ivar name: Required. - :vartype name: str :ivar age: Required. :vartype age: int """ @@ -74,10 +72,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Siamese(Cat): """The third level model in the normal multiple levels inheritance. - :ivar name: Required. - :vartype name: str - :ivar age: Required. - :vartype age: int :ivar smart: Required. :vartype smart: bool """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py index b891d4c569..e9311e0098 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py @@ -47,8 +47,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. - :ivar extension: - :vartype extension: list[~typetest.model.recursive.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index 17c67e818d..e47d91033c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -95,8 +95,6 @@ class Eagle(Bird, discriminator="eagle"): """The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "eagle". :vartype kind: str :ivar friends: @@ -131,14 +129,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="eagle", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "eagle" class Goose(Bird, discriminator="goose"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "goose". :vartype kind: str """ @@ -161,14 +158,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="goose", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "goose" class SeaGull(Bird, discriminator="seagull"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "seagull". :vartype kind: str """ @@ -191,14 +187,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="seagull", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "seagull" class Sparrow(Bird, discriminator="sparrow"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "sparrow". :vartype kind: str """ @@ -221,14 +216,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="sparrow", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "sparrow" class TRex(Dinosaur, discriminator="t-rex"): """The second level legacy model in polymorphic single level inheritance. - :ivar size: Required. - :vartype size: int :ivar kind: Required. Default value is "t-rex". :vartype kind: str """ @@ -251,4 +245,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="t-rex", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "t-rex" diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index 4a0318014f..2eed600c32 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -49,8 +49,6 @@ class DifferentSpreadFloatDerived(DifferentSpreadFloatRecord): """The model extends from a model that spread Record with the different known property type. - :ivar name: The id property. Required. - :vartype name: str :ivar derived_prop: The index property. Required. :vartype derived_prop: float """ @@ -109,8 +107,6 @@ class DifferentSpreadModelArrayDerived(DifferentSpreadModelArrayRecord): """The model extends from a model that spread Record with the different known property type. - :ivar known_prop: Required. - :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: list[~typetest.property.additionalproperties.models.ModelForRecord] """ @@ -171,8 +167,6 @@ class DifferentSpreadModelDerived(DifferentSpreadModelRecord): """The model extends from a model that spread Record with the different known property type. - :ivar known_prop: Required. - :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: ~typetest.property.additionalproperties.models.ModelForRecord """ @@ -233,8 +227,6 @@ class DifferentSpreadStringDerived(DifferentSpreadStringRecord): """The model extends from a model that spread Record with the different known property type. - :ivar id: The name property. Required. - :vartype id: float :ivar derived_prop: The index property. Required. :vartype derived_prop: str """ @@ -408,8 +400,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExtendsUnknownAdditionalPropertiesDerived(ExtendsUnknownAdditionalProperties): # pylint: disable=name-too-long """The model extends from a type that extends from Record. - :ivar name: The name property. Required. - :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -483,8 +473,6 @@ class ExtendsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. - :ivar name: The name property. Required. - :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -517,7 +505,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="derived", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "derived" class IsFloatAdditionalProperties(_Model): @@ -667,8 +656,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IsUnknownAdditionalPropertiesDerived(IsUnknownAdditionalProperties): """The model extends from a type that is Record type. - :ivar name: The name property. Required. - :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -742,8 +729,6 @@ class IsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. - :ivar name: The name property. Required. - :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -776,7 +761,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="derived", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "derived" class ModelForRecord(_Model): diff --git a/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py b/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py index 1159b391e9..b5181f64ab 100644 --- a/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py @@ -41,8 +41,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. - :ivar extension: - :vartype extension: list[~generation.subdir._generated.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index a2a3bb05d0..3ceee8e189 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -48,8 +48,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cobra(Snake, discriminator="cobra"): """Cobra model. - :ivar length: Length of the snake. Required. - :vartype length: int :ivar kind: discriminator property. Required. Species cobra :vartype kind: str or ~typetest.model.enumdiscriminator.models.COBRA """ @@ -72,7 +70,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind=SnakeKind.COBRA, **kwargs) + super().__init__(*args, **kwargs) + self.kind = SnakeKind.COBRA class Dog(_Model): @@ -115,8 +114,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Golden(Dog, discriminator="golden"): """Golden dog model. - :ivar weight: Weight of the dog. Required. - :vartype weight: int :ivar kind: discriminator property. Required. Species golden :vartype kind: str or ~typetest.model.enumdiscriminator.models.GOLDEN """ @@ -139,4 +136,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind=DogKind.GOLDEN, **kwargs) + super().__init__(*args, **kwargs) + self.kind = DogKind.GOLDEN diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index a16d91d327..bc6d5ef180 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -54,8 +54,6 @@ class Shark(Fish, discriminator="shark"): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GoblinShark, SawShark - :ivar age: Required. - :vartype age: int :ivar kind: Required. Default value is "shark". :vartype kind: str :ivar sharktype: Required. Default value is None. @@ -84,16 +82,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="shark", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "shark" class GoblinShark(Shark, discriminator="goblin"): """The third level model GoblinShark in polymorphic multiple levels inheritance. - :ivar age: Required. - :vartype age: int - :ivar kind: Required. Default value is "shark". - :vartype kind: str :ivar sharktype: Required. Default value is "goblin". :vartype sharktype: str """ @@ -117,15 +112,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, sharktype="goblin", **kwargs) + super().__init__(*args, **kwargs) + self.sharktype = "goblin" class Salmon(Fish, discriminator="salmon"): """The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances. - :ivar age: Required. - :vartype age: int :ivar kind: Required. Default value is "salmon". :vartype kind: str :ivar friends: @@ -160,16 +154,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="salmon", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "salmon" class SawShark(Shark, discriminator="saw"): """The third level model SawShark in polymorphic multiple levels inheritance. - :ivar age: Required. - :vartype age: int - :ivar kind: Required. Default value is "shark". - :vartype kind: str :ivar sharktype: Required. Default value is "saw". :vartype sharktype: str """ @@ -193,4 +184,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, sharktype="saw", **kwargs) + super().__init__(*args, **kwargs) + self.sharktype = "saw" diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py index 838cd399fb..482d954df8 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py @@ -37,8 +37,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cat(Pet): """The second level model in the normal multiple levels inheritance. - :ivar name: Required. - :vartype name: str :ivar age: Required. :vartype age: int """ @@ -68,10 +66,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Siamese(Cat): """The third level model in the normal multiple levels inheritance. - :ivar name: Required. - :vartype name: str - :ivar age: Required. - :vartype age: int :ivar smart: Required. :vartype smart: bool """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py index 1daf06af3f..bf90e918c4 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py @@ -41,8 +41,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. - :ivar extension: - :vartype extension: list[~typetest.model.recursive.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index e281838f28..8f8c58fec5 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -89,8 +89,6 @@ class Eagle(Bird, discriminator="eagle"): """The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "eagle". :vartype kind: str :ivar friends: @@ -125,14 +123,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="eagle", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "eagle" class Goose(Bird, discriminator="goose"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "goose". :vartype kind: str """ @@ -155,14 +152,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="goose", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "goose" class SeaGull(Bird, discriminator="seagull"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "seagull". :vartype kind: str """ @@ -185,14 +181,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="seagull", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "seagull" class Sparrow(Bird, discriminator="sparrow"): """The second level model in polymorphic single level inheritance. - :ivar wingspan: Required. - :vartype wingspan: int :ivar kind: Required. Default value is "sparrow". :vartype kind: str """ @@ -215,14 +210,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="sparrow", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "sparrow" class TRex(Dinosaur, discriminator="t-rex"): """The second level legacy model in polymorphic single level inheritance. - :ivar size: Required. - :vartype size: int :ivar kind: Required. Default value is "t-rex". :vartype kind: str """ @@ -245,4 +239,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="t-rex", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "t-rex" diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index c5373cd883..7aa1267908 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -43,8 +43,6 @@ class DifferentSpreadFloatDerived(DifferentSpreadFloatRecord): """The model extends from a model that spread Record with the different known property type. - :ivar name: The id property. Required. - :vartype name: str :ivar derived_prop: The index property. Required. :vartype derived_prop: float """ @@ -103,8 +101,6 @@ class DifferentSpreadModelArrayDerived(DifferentSpreadModelArrayRecord): """The model extends from a model that spread Record with the different known property type. - :ivar known_prop: Required. - :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: list[~typetest.property.additionalproperties.models.ModelForRecord] """ @@ -165,8 +161,6 @@ class DifferentSpreadModelDerived(DifferentSpreadModelRecord): """The model extends from a model that spread Record with the different known property type. - :ivar known_prop: Required. - :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: ~typetest.property.additionalproperties.models.ModelForRecord """ @@ -227,8 +221,6 @@ class DifferentSpreadStringDerived(DifferentSpreadStringRecord): """The model extends from a model that spread Record with the different known property type. - :ivar id: The name property. Required. - :vartype id: float :ivar derived_prop: The index property. Required. :vartype derived_prop: str """ @@ -402,8 +394,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExtendsUnknownAdditionalPropertiesDerived(ExtendsUnknownAdditionalProperties): # pylint: disable=name-too-long """The model extends from a type that extends from Record. - :ivar name: The name property. Required. - :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -477,8 +467,6 @@ class ExtendsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. - :ivar name: The name property. Required. - :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -511,7 +499,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="derived", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "derived" class IsFloatAdditionalProperties(_Model): @@ -661,8 +650,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IsUnknownAdditionalPropertiesDerived(IsUnknownAdditionalProperties): """The model extends from a type that is Record type. - :ivar name: The name property. Required. - :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -736,8 +723,6 @@ class IsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. - :ivar name: The name property. Required. - :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -770,7 +755,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, kind="derived", **kwargs) + super().__init__(*args, **kwargs) + self.kind = "derived" class ModelForRecord(_Model): From cf5def7c6dd881d9c67175cdd3bfb4c798ac3f78 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 07:47:12 +0000 Subject: [PATCH 04/24] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index bf5735b08b..3fd24f164e 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjk0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.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 5fe0e5d0db..8cf9d0eec6 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjk0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From 8e44a6f122e935f943876150e35e4494a7635beb Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 09:45:16 +0000 Subject: [PATCH 05/24] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 3fd24f164e..91e95095cb 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjk0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.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 8cf9d0eec6..1e4467c8c6 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjk0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From aed9f9738333dd2c454f1df7f481bf45ac791d2a Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 09:46:14 +0000 Subject: [PATCH 06/24] Update dependencies (2025-08-11 09:46:14) --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42b9a0ded4..0d15b2d001 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1677,8 +1677,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz} version: 0.15.1 engines: {node: '>=20.0.0'} peerDependencies: @@ -6460,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMjcyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm)': dependencies: '@azure-tools/typespec-autorest': 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) From b9e24bda202e7603349ad50fc1133f0f07280b06 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 11 Aug 2025 09:51:10 +0000 Subject: [PATCH 07/24] Regenerate for typespec-python (2025-08-11 09:51:10) --- .../clientgenerator/core/access/models/_models.py | 2 +- .../typetest/model/enumdiscriminator/models/_models.py | 4 ++-- .../model/nesteddiscriminator/models/_models.py | 8 ++++---- .../model/singlediscriminator/models/_models.py | 10 +++++----- .../property/additionalproperties/models/_models.py | 4 ++-- .../typetest/model/enumdiscriminator/models/_models.py | 4 ++-- .../model/nesteddiscriminator/models/_models.py | 8 ++++---- .../model/singlediscriminator/models/_models.py | 10 +++++----- .../property/additionalproperties/models/_models.py | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) 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/models/_models.py index fc94065909..46c58e3393 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/models/_models.py @@ -304,7 +304,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "real" + self.kind = "real" # type: ignore class SharedModel(_Model): diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index 8ffff82e5d..6482dcb9e2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -77,7 +77,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = SnakeKind.COBRA + self.kind = SnakeKind.COBRA # type: ignore class Dog(_Model): @@ -143,4 +143,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = DogKind.GOLDEN + self.kind = DogKind.GOLDEN # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index 958ab47e3e..6bacfe5b70 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -89,7 +89,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "shark" + self.kind = "shark" # type: ignore class GoblinShark(Shark, discriminator="goblin"): @@ -119,7 +119,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sharktype = "goblin" + self.sharktype = "goblin" # type: ignore class Salmon(Fish, discriminator="salmon"): @@ -161,7 +161,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "salmon" + self.kind = "salmon" # type: ignore class SawShark(Shark, discriminator="saw"): @@ -191,4 +191,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sharktype = "saw" + self.sharktype = "saw" # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index e47d91033c..cb197e2409 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -130,7 +130,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "eagle" + self.kind = "eagle" # type: ignore class Goose(Bird, discriminator="goose"): @@ -159,7 +159,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "goose" + self.kind = "goose" # type: ignore class SeaGull(Bird, discriminator="seagull"): @@ -188,7 +188,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "seagull" + self.kind = "seagull" # type: ignore class Sparrow(Bird, discriminator="sparrow"): @@ -217,7 +217,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "sparrow" + self.kind = "sparrow" # type: ignore class TRex(Dinosaur, discriminator="t-rex"): @@ -246,4 +246,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "t-rex" + self.kind = "t-rex" # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index 2eed600c32..9af90398e3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -506,7 +506,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "derived" + self.kind = "derived" # type: ignore class IsFloatAdditionalProperties(_Model): @@ -762,7 +762,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "derived" + self.kind = "derived" # type: ignore class ModelForRecord(_Model): diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index 3ceee8e189..5354db5f5b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -71,7 +71,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = SnakeKind.COBRA + self.kind = SnakeKind.COBRA # type: ignore class Dog(_Model): @@ -137,4 +137,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = DogKind.GOLDEN + self.kind = DogKind.GOLDEN # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index bc6d5ef180..ccfb525aa8 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -83,7 +83,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "shark" + self.kind = "shark" # type: ignore class GoblinShark(Shark, discriminator="goblin"): @@ -113,7 +113,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sharktype = "goblin" + self.sharktype = "goblin" # type: ignore class Salmon(Fish, discriminator="salmon"): @@ -155,7 +155,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "salmon" + self.kind = "salmon" # type: ignore class SawShark(Shark, discriminator="saw"): @@ -185,4 +185,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sharktype = "saw" + self.sharktype = "saw" # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index 8f8c58fec5..e22b4a5c4d 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -124,7 +124,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "eagle" + self.kind = "eagle" # type: ignore class Goose(Bird, discriminator="goose"): @@ -153,7 +153,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "goose" + self.kind = "goose" # type: ignore class SeaGull(Bird, discriminator="seagull"): @@ -182,7 +182,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "seagull" + self.kind = "seagull" # type: ignore class Sparrow(Bird, discriminator="sparrow"): @@ -211,7 +211,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "sparrow" + self.kind = "sparrow" # type: ignore class TRex(Dinosaur, discriminator="t-rex"): @@ -240,4 +240,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "t-rex" + self.kind = "t-rex" # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index 7aa1267908..a4774d51e2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -500,7 +500,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "derived" + self.kind = "derived" # type: ignore class IsFloatAdditionalProperties(_Model): @@ -756,7 +756,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = "derived" + self.kind = "derived" # type: ignore class ModelForRecord(_Model): From eeab90898b01df5ad3ce2c35b46ba64e5fada757 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 11 Aug 2025 18:27:53 +0800 Subject: [PATCH 08/24] update --- .../typespec-python/scripts/eng/regenerate.ts | 4 +- .../CHANGELOG.md | 5 + .../LICENSE | 21 + .../MANIFEST.in | 9 + .../README.md | 43 + .../apiview-properties.json | 18 + .../dev_requirements.txt | 3 + .../generated_tests/conftest.py | 39 + ...y_building_animal_operations_operations.py | 48 + ...ding_animal_operations_operations_async.py | 49 + ...rchy_building_dog_operations_operations.py | 31 + ...uilding_dog_operations_operations_async.py | 32 + ...rchy_building_pet_operations_operations.py | 48 + ...uilding_pet_operations_operations_async.py | 49 + .../generated_tests/testpreparer.py | 26 + .../generated_tests/testpreparer_async.py | 20 + .../pyproject.toml | 61 + .../specs/__init__.py | 1 + .../specs/azure/__init__.py | 1 + .../specs/azure/clientgenerator/__init__.py | 1 + .../azure/clientgenerator/core/__init__.py | 1 + .../core/hierarchybuilding/__init__.py | 32 + .../core/hierarchybuilding/_client.py | 106 + .../core/hierarchybuilding/_configuration.py | 42 + .../core/hierarchybuilding/_patch.py | 21 + .../core/hierarchybuilding/_utils/__init__.py | 6 + .../hierarchybuilding/_utils/model_base.py | 1233 ++++++++++ .../hierarchybuilding/_utils/serialization.py | 2032 +++++++++++++++++ .../core/hierarchybuilding/_version.py | 9 + .../core/hierarchybuilding/aio/__init__.py | 29 + .../core/hierarchybuilding/aio/_client.py | 108 + .../hierarchybuilding/aio/_configuration.py | 42 + .../core/hierarchybuilding/aio/_patch.py | 21 + .../aio/operations/__init__.py | 29 + .../aio/operations/_operations.py | 683 ++++++ .../aio/operations/_patch.py | 21 + .../core/hierarchybuilding/models/__init__.py | 31 + .../core/hierarchybuilding/models/_models.py | 123 + .../core/hierarchybuilding/models/_patch.py | 21 + .../hierarchybuilding/operations/__init__.py | 29 + .../operations/_operations.py | 755 ++++++ .../hierarchybuilding/operations/_patch.py | 21 + .../core/hierarchybuilding/py.typed | 1 + ...enerator_core_hierrarchy_building_async.py | 50 + ...ient_generator_core_hierrarchy_building.py | 45 + .../test/azure/requirements.txt | 1 + 46 files changed, 6000 insertions(+), 1 deletion(-) create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/CHANGELOG.md create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/LICENSE create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/MANIFEST.in create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/README.md create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/apiview-properties.json create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/dev_requirements.txt create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/conftest.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations_async.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations_async.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations_async.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer_async.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_client.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_version.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_client.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/py.typed create mode 100644 packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py create mode 100644 packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_hierrarchy_building.py diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index f832053bf9..7d8350053f 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -24,7 +24,6 @@ const SKIP_SPECS = [ "type/union/discriminated", "client-operation-group", "azure/client-generator-core/api-version", - "azure/client-generator-core/hierarchy-building", ]; const AZURE_EMITTER_OPTIONS: Record | Record[]> = { @@ -52,6 +51,9 @@ const AZURE_EMITTER_OPTIONS: Record | Record + +## Getting started + +### Install the package + +```bash +python -m pip install specs-azure-clientgenerator-core-hierarchybuilding +``` + +#### Prequisites + +- Python 3.9 or later is required to use this package. +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Specs Azure Clientgenerator Core Hierarchybuilding instance. + + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, +see the Code of Conduct FAQ or contact opencode@microsoft.com with any +additional questions or comments. + + +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials +[azure_identity_pip]: https://pypi.org/project/azure-identity/ +[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential +[pip]: https://pypi.org/project/pip/ +[azure_sub]: https://azure.microsoft.com/free/ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/apiview-properties.json new file mode 100644 index 0000000000..f14b69de13 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/apiview-properties.json @@ -0,0 +1,18 @@ +{ + "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding", + "CrossLanguageDefinitionId": { + "specs.azure.clientgenerator.core.hierarchybuilding.models.Animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Animal", + "specs.azure.clientgenerator.core.hierarchybuilding.models.Pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Pet", + "specs.azure.clientgenerator.core.hierarchybuilding.models.Dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Dog", + "specs.azure.clientgenerator.core.hierarchybuilding.operations.AnimalOperationsOperations.update_pet_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updatePetAsAnimal", + "specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.AnimalOperationsOperations.update_pet_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updatePetAsAnimal", + "specs.azure.clientgenerator.core.hierarchybuilding.operations.AnimalOperationsOperations.update_dog_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updateDogAsAnimal", + "specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.AnimalOperationsOperations.update_dog_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updateDogAsAnimal", + "specs.azure.clientgenerator.core.hierarchybuilding.operations.PetOperationsOperations.update_pet_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updatePetAsPet", + "specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.PetOperationsOperations.update_pet_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updatePetAsPet", + "specs.azure.clientgenerator.core.hierarchybuilding.operations.PetOperationsOperations.update_dog_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updateDogAsPet", + "specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.PetOperationsOperations.update_dog_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updateDogAsPet", + "specs.azure.clientgenerator.core.hierarchybuilding.operations.DogOperationsOperations.update_dog_as_dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.DogOperations.updateDogAsDog", + "specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.DogOperationsOperations.update_dog_as_dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.DogOperations.updateDogAsDog" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/dev_requirements.txt b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/dev_requirements.txt new file mode 100644 index 0000000000..1054864714 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/dev_requirements.txt @@ -0,0 +1,3 @@ +-e ../../../tools/azure-sdk-tools +../../core/azure-core +aiohttp \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/conftest.py new file mode 100644 index 0000000000..0c57042410 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/conftest.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + hierarchybuilding_subscription_id = os.environ.get( + "HIERARCHYBUILDING_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + hierarchybuilding_tenant_id = os.environ.get("HIERARCHYBUILDING_TENANT_ID", "00000000-0000-0000-0000-000000000000") + hierarchybuilding_client_id = os.environ.get("HIERARCHYBUILDING_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + hierarchybuilding_client_secret = os.environ.get( + "HIERARCHYBUILDING_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=hierarchybuilding_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=hierarchybuilding_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=hierarchybuilding_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=hierarchybuilding_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations.py new file mode 100644 index 0000000000..afe806db43 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import HierarchyBuildingClientTestBase, HierarchyBuildingPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingAnimalOperationsOperations(HierarchyBuildingClientTestBase): + @HierarchyBuildingPreparer() + @recorded_by_proxy + def test_animal_operations_update_pet_as_animal(self, hierarchybuilding_endpoint): + client = self.create_client(endpoint=hierarchybuilding_endpoint) + response = client.animal_operations.update_pet_as_animal( + animal={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + + @HierarchyBuildingPreparer() + @recorded_by_proxy + def test_animal_operations_update_dog_as_animal(self, hierarchybuilding_endpoint): + client = self.create_client(endpoint=hierarchybuilding_endpoint) + response = client.animal_operations.update_dog_as_animal( + animal={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations_async.py new file mode 100644 index 0000000000..f57125c5e9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_animal_operations_operations_async.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import HierarchyBuildingPreparer +from testpreparer_async import HierarchyBuildingClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingAnimalOperationsOperationsAsync(HierarchyBuildingClientTestBaseAsync): + @HierarchyBuildingPreparer() + @recorded_by_proxy_async + async def test_animal_operations_update_pet_as_animal(self, hierarchybuilding_endpoint): + client = self.create_async_client(endpoint=hierarchybuilding_endpoint) + response = await client.animal_operations.update_pet_as_animal( + animal={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + + @HierarchyBuildingPreparer() + @recorded_by_proxy_async + async def test_animal_operations_update_dog_as_animal(self, hierarchybuilding_endpoint): + client = self.create_async_client(endpoint=hierarchybuilding_endpoint) + response = await client.animal_operations.update_dog_as_animal( + animal={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations.py new file mode 100644 index 0000000000..4f978c6b44 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import HierarchyBuildingClientTestBase, HierarchyBuildingPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingDogOperationsOperations(HierarchyBuildingClientTestBase): + @HierarchyBuildingPreparer() + @recorded_by_proxy + def test_dog_operations_update_dog_as_dog(self, hierarchybuilding_endpoint): + client = self.create_client(endpoint=hierarchybuilding_endpoint) + response = client.dog_operations.update_dog_as_dog( + dog={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations_async.py new file mode 100644 index 0000000000..fff7a22366 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_dog_operations_operations_async.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. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import HierarchyBuildingPreparer +from testpreparer_async import HierarchyBuildingClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingDogOperationsOperationsAsync(HierarchyBuildingClientTestBaseAsync): + @HierarchyBuildingPreparer() + @recorded_by_proxy_async + async def test_dog_operations_update_dog_as_dog(self, hierarchybuilding_endpoint): + client = self.create_async_client(endpoint=hierarchybuilding_endpoint) + response = await client.dog_operations.update_dog_as_dog( + dog={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations.py new file mode 100644 index 0000000000..dd1262e247 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import HierarchyBuildingClientTestBase, HierarchyBuildingPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingPetOperationsOperations(HierarchyBuildingClientTestBase): + @HierarchyBuildingPreparer() + @recorded_by_proxy + def test_pet_operations_update_pet_as_pet(self, hierarchybuilding_endpoint): + client = self.create_client(endpoint=hierarchybuilding_endpoint) + response = client.pet_operations.update_pet_as_pet( + pet={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + + @HierarchyBuildingPreparer() + @recorded_by_proxy + def test_pet_operations_update_dog_as_pet(self, hierarchybuilding_endpoint): + client = self.create_client(endpoint=hierarchybuilding_endpoint) + response = client.pet_operations.update_dog_as_pet( + pet={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations_async.py new file mode 100644 index 0000000000..59d00ce9ed --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/test_hierarchy_building_pet_operations_operations_async.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import HierarchyBuildingPreparer +from testpreparer_async import HierarchyBuildingClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHierarchyBuildingPetOperationsOperationsAsync(HierarchyBuildingClientTestBaseAsync): + @HierarchyBuildingPreparer() + @recorded_by_proxy_async + async def test_pet_operations_update_pet_as_pet(self, hierarchybuilding_endpoint): + client = self.create_async_client(endpoint=hierarchybuilding_endpoint) + response = await client.pet_operations.update_pet_as_pet( + pet={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + + @HierarchyBuildingPreparer() + @recorded_by_proxy_async + async def test_pet_operations_update_dog_as_pet(self, hierarchybuilding_endpoint): + client = self.create_async_client(endpoint=hierarchybuilding_endpoint) + response = await client.pet_operations.update_dog_as_pet( + pet={ + "breed": "str", + "kind": "dog", + "name": "str", + "trained": bool + } +, + ) + + # please add some check logic here by yourself + # ... + diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer.py new file mode 100644 index 0000000000..64d357970c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools +from specs.azure.clientgenerator.core.hierarchybuilding import HierarchyBuildingClient + + +class HierarchyBuildingClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(HierarchyBuildingClient) + return self.create_client_from_credential( + HierarchyBuildingClient, + credential=credential, + endpoint=endpoint, + ) + + +HierarchyBuildingPreparer = functools.partial( + PowerShellPreparer, "hierarchybuilding", hierarchybuilding_endpoint="https://fake_hierarchybuilding_endpoint.com" +) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer_async.py new file mode 100644 index 0000000000..5b775bd4cd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/generated_tests/testpreparer_async.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from devtools_testutils import AzureRecordedTestCase +from specs.azure.clientgenerator.core.hierarchybuilding.aio import HierarchyBuildingClient + + +class HierarchyBuildingClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(HierarchyBuildingClient, is_async=True) + return self.create_client_from_credential( + HierarchyBuildingClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml new file mode 100644 index 0000000000..283f61a91a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +[build-system] +requires = ["setuptools>=77.0.3", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "specs-azure-clientgenerator-core-hierarchybuilding" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Corporation Azure Specs Azure Clientgenerator Core Hierarchybuilding Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +keywords = ["azure", "azure sdk"] + +dependencies = [ + "isodate>=0.6.1", + "azure-core>=1.35.0", + "typing-extensions>=4.6.0", +] +dynamic = [ +"version", "readme" +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" + +[tool.setuptools.dynamic] +version = {attr = "specs.azure.clientgenerator.core.hierarchybuilding._version.VERSION"} +readme = {file = ["README.md"], content-type = "text/markdown"} + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "samples*", + "doc*", + "specs", + "specs.azure", + "specs.azure.clientgenerator", + "specs.azure.clientgenerator.core", +] + +[tool.setuptools.package-data] +pytyped = ["py.typed"] diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/__init__.py new file mode 100644 index 0000000000..d55ccad1f5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/__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-hierarchy-building/specs/azure/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/__init__.py new file mode 100644 index 0000000000..d55ccad1f5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/__init__.py new file mode 100644 index 0000000000..d55ccad1f5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/__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-hierarchy-building/specs/azure/clientgenerator/core/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/__init__.py new file mode 100644 index 0000000000..d55ccad1f5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/__init__.py new file mode 100644 index 0000000000..9bd9cfb1f5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/__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 HierarchyBuildingClient # 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__ = [ + "HierarchyBuildingClient", +] +__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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_client.py new file mode 100644 index 0000000000..2fbc7d670d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_client.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any +from typing_extensions import Self + +from azure.core import PipelineClient +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse + +from ._configuration import HierarchyBuildingClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import AnimalOperationsOperations, DogOperationsOperations, PetOperationsOperations + + +class HierarchyBuildingClient: # pylint: disable=client-accepts-api-version-keyword + """Test for @hierarchyBuilding decorator. + + :ivar animal_operations: AnimalOperationsOperations operations + :vartype animal_operations: + specs.azure.clientgenerator.core.hierarchybuilding.operations.AnimalOperationsOperations + :ivar pet_operations: PetOperationsOperations operations + :vartype pet_operations: + specs.azure.clientgenerator.core.hierarchybuilding.operations.PetOperationsOperations + :ivar dog_operations: DogOperationsOperations operations + :vartype dog_operations: + specs.azure.clientgenerator.core.hierarchybuilding.operations.DogOperationsOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = HierarchyBuildingClientConfiguration(endpoint=endpoint, **kwargs) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.animal_operations = AnimalOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.pet_operations = PetOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.dog_operations = DogOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_configuration.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_configuration.py new file mode 100644 index 0000000000..62d100d2fd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_configuration.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.pipeline import policies + +from ._version import VERSION + + +class HierarchyBuildingClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for HierarchyBuildingClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-hierarchybuilding/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_patch.py new file mode 100644 index 0000000000..8bcb627aa4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/__init__.py new file mode 100644 index 0000000000..8026245c2a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py new file mode 100644 index 0000000000..e9ac32aaf9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py @@ -0,0 +1,1233 @@ +# pylint: disable=line-too-long,useless-suppression,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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: typing.Dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py new file mode 100644 index 0000000000..eb86ea23c9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py @@ -0,0 +1,2032 @@ +# pylint: disable=line-too-long,useless-suppression,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. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore +from typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_version.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_version.py new file mode 100644 index 0000000000..be71c81bd2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/__init__.py new file mode 100644 index 0000000000..7584f49eb0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/__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 ._client import HierarchyBuildingClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HierarchyBuildingClient", +] +__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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_client.py new file mode 100644 index 0000000000..ffce83178a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_client.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable +from typing_extensions import Self + +from azure.core import AsyncPipelineClient +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import HierarchyBuildingClientConfiguration +from .operations import AnimalOperationsOperations, DogOperationsOperations, PetOperationsOperations + + +class HierarchyBuildingClient: # pylint: disable=client-accepts-api-version-keyword + """Test for @hierarchyBuilding decorator. + + :ivar animal_operations: AnimalOperationsOperations operations + :vartype animal_operations: + specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.AnimalOperationsOperations + :ivar pet_operations: PetOperationsOperations operations + :vartype pet_operations: + specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.PetOperationsOperations + :ivar dog_operations: DogOperationsOperations operations + :vartype dog_operations: + specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.DogOperationsOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = HierarchyBuildingClientConfiguration(endpoint=endpoint, **kwargs) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.animal_operations = AnimalOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.pet_operations = PetOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.dog_operations = DogOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_configuration.py new file mode 100644 index 0000000000..1d8d570cc5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_configuration.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.pipeline import policies + +from .._version import VERSION + + +class HierarchyBuildingClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for HierarchyBuildingClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-hierarchybuilding/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_patch.py new file mode 100644 index 0000000000..8bcb627aa4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/__init__.py new file mode 100644 index 0000000000..812f734f84 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/__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 ._operations import AnimalOperationsOperations # type: ignore +from ._operations import PetOperationsOperations # type: ignore +from ._operations import DogOperationsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AnimalOperationsOperations", + "PetOperationsOperations", + "DogOperationsOperations", +] +__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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py new file mode 100644 index 0000000000..7d01201634 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py @@ -0,0 +1,683 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 collections.abc import MutableMapping +from io import IOBase +import json +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 ..._utils.model_base import SdkJSONEncoder, _deserialize +from ..._utils.serialization import Deserializer, Serializer +from ...operations._operations import ( + build_animal_operations_update_dog_as_animal_request, + build_animal_operations_update_pet_as_animal_request, + build_dog_operations_update_dog_as_dog_request, + build_pet_operations_update_dog_as_pet_request, + build_pet_operations_update_pet_as_pet_request, +) +from .._configuration import HierarchyBuildingClientConfiguration + +JSON = MutableMapping[str, Any] +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AnimalOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.aio.HierarchyBuildingClient`'s + :attr:`animal_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_pet_as_animal( + self, animal: _models.Animal, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_pet_as_animal( + self, animal: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_pet_as_animal( + self, animal: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_pet_as_animal( + self, animal: Union[_models.Animal, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Is one of the following types: Animal, JSON, IO[bytes] Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal or JSON or + IO[bytes] + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Animal] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(animal, (IOBase, bytes)): + _content = animal + else: + _content = json.dumps(animal, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_animal_operations_update_pet_as_animal_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Animal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_dog_as_animal( + self, animal: _models.Animal, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_animal( + self, animal: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_animal( + self, animal: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_dog_as_animal( + self, animal: Union[_models.Animal, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Is one of the following types: Animal, JSON, IO[bytes] Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal or JSON or + IO[bytes] + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Animal] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(animal, (IOBase, bytes)): + _content = animal + else: + _content = json.dumps(animal, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_animal_operations_update_dog_as_animal_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Animal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PetOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.aio.HierarchyBuildingClient`'s + :attr:`pet_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_pet_as_pet( + self, pet: _models.Pet, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_pet_as_pet( + self, pet: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_pet_as_pet( + self, pet: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_pet_as_pet(self, pet: Union[_models.Pet, JSON, IO[bytes]], **kwargs: Any) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Is one of the following types: Pet, JSON, IO[bytes] Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet or JSON or IO[bytes] + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Pet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pet, (IOBase, bytes)): + _content = pet + else: + _content = json.dumps(pet, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pet_operations_update_pet_as_pet_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Pet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_dog_as_pet( + self, pet: _models.Pet, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_pet( + self, pet: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_pet( + self, pet: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_dog_as_pet(self, pet: Union[_models.Pet, JSON, IO[bytes]], **kwargs: Any) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Is one of the following types: Pet, JSON, IO[bytes] Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet or JSON or IO[bytes] + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Pet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pet, (IOBase, bytes)): + _content = pet + else: + _content = json.dumps(pet, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pet_operations_update_dog_as_pet_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Pet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DogOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.aio.HierarchyBuildingClient`'s + :attr:`dog_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_dog_as_dog( + self, dog: _models.Dog, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_dog( + self, dog: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_dog_as_dog( + self, dog: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_dog_as_dog(self, dog: Union[_models.Dog, JSON, IO[bytes]], **kwargs: Any) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Is one of the following types: Dog, JSON, IO[bytes] Required. + :type dog: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog or JSON or IO[bytes] + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Dog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(dog, (IOBase, bytes)): + _content = dog + else: + _content = json.dumps(dog, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_dog_operations_update_dog_as_dog_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Dog, 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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_patch.py new file mode 100644 index 0000000000..8bcb627aa4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/__init__.py new file mode 100644 index 0000000000..085996a876 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 + Animal, + Dog, + Pet, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Animal", + "Dog", + "Pet", +] +__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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py new file mode 100644 index 0000000000..2a85dd117c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py @@ -0,0 +1,123 @@ +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +from typing import Any, Dict, Literal, Mapping, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field + + +class Animal(_Model): + """Animal. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + Dog, Pet + + :ivar kind: The kind of animal. Required. Default value is None. + :vartype kind: str + :ivar name: Name of the animal. Required. + :vartype name: str + """ + + __mapping__: Dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of animal. Required. Default value is None.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the animal. Required.""" + + @overload + def __init__( + self, + *, + kind: str, + 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 Pet(Animal, discriminator="pet"): + """Pet. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + Dog + + :ivar kind: Required. Default value is "pet". + :vartype kind: str + :ivar trained: Whether the pet is trained. Required. + :vartype trained: bool + """ + + __mapping__: Dict[str, _Model] = {} + kind: Literal["pet"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"pet\".""" + trained: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the pet is trained. Required.""" + + @overload + def __init__( + self, + *, + name: str, + trained: 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) + self.kind = "pet" # type: ignore + + +class Dog(Pet, discriminator="dog"): + """Dog. + + :ivar kind: Required. Default value is "dog". + :vartype kind: str + :ivar breed: The breed of the dog. Required. + :vartype breed: str + """ + + kind: Literal["dog"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"dog\".""" + breed: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The breed of the dog. Required.""" + + @overload + def __init__( + self, + *, + name: str, + trained: bool, + breed: 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) + self.kind = "dog" # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_patch.py new file mode 100644 index 0000000000..8bcb627aa4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/__init__.py new file mode 100644 index 0000000000..812f734f84 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/__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 ._operations import AnimalOperationsOperations # type: ignore +from ._operations import PetOperationsOperations # type: ignore +from ._operations import DogOperationsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AnimalOperationsOperations", + "PetOperationsOperations", + "DogOperationsOperations", +] +__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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py new file mode 100644 index 0000000000..d3922db855 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py @@ -0,0 +1,755 @@ +# 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 collections.abc import MutableMapping +from io import IOBase +import json +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 HierarchyBuildingClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize +from .._utils.serialization import Deserializer, Serializer + +JSON = MutableMapping[str, Any] +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_animal_operations_update_pet_as_animal_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 = "/azure/client-generator-core/hierarchy-building/pet/as-animal" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_animal_operations_update_dog_as_animal_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 = "/azure/client-generator-core/hierarchy-building/dog/as-animal" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_pet_operations_update_pet_as_pet_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 = "/azure/client-generator-core/hierarchy-building/pet/as-pet" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_pet_operations_update_dog_as_pet_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 = "/azure/client-generator-core/hierarchy-building/dog/as-pet" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_dog_operations_update_dog_as_dog_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 = "/azure/client-generator-core/hierarchy-building/dog/as-dog" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +class AnimalOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.HierarchyBuildingClient`'s + :attr:`animal_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_pet_as_animal( + self, animal: _models.Animal, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_pet_as_animal( + self, animal: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_pet_as_animal( + self, animal: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Required. + :type animal: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_pet_as_animal(self, animal: Union[_models.Animal, JSON, IO[bytes]], **kwargs: Any) -> _models.Animal: + """Update a pet as an animal. + + :param animal: Is one of the following types: Animal, JSON, IO[bytes] Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal or JSON or + IO[bytes] + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Animal] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(animal, (IOBase, bytes)): + _content = animal + else: + _content = json.dumps(animal, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_animal_operations_update_pet_as_animal_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Animal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_dog_as_animal( + self, animal: _models.Animal, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_animal( + self, animal: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_animal( + self, animal: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Required. + :type animal: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_dog_as_animal(self, animal: Union[_models.Animal, JSON, IO[bytes]], **kwargs: Any) -> _models.Animal: + """Update a dog as an animal. + + :param animal: Is one of the following types: Animal, JSON, IO[bytes] Required. + :type animal: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal or JSON or + IO[bytes] + :return: Animal. The Animal is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Animal + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Animal] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(animal, (IOBase, bytes)): + _content = animal + else: + _content = json.dumps(animal, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_animal_operations_update_dog_as_animal_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Animal, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PetOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.HierarchyBuildingClient`'s + :attr:`pet_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_pet_as_pet( + self, pet: _models.Pet, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_pet_as_pet(self, pet: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_pet_as_pet( + self, pet: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Required. + :type pet: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_pet_as_pet(self, pet: Union[_models.Pet, JSON, IO[bytes]], **kwargs: Any) -> _models.Pet: + """Update a pet as a pet. + + :param pet: Is one of the following types: Pet, JSON, IO[bytes] Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet or JSON or IO[bytes] + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Pet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pet, (IOBase, bytes)): + _content = pet + else: + _content = json.dumps(pet, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pet_operations_update_pet_as_pet_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Pet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_dog_as_pet( + self, pet: _models.Pet, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_pet(self, pet: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_pet( + self, pet: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Required. + :type pet: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_dog_as_pet(self, pet: Union[_models.Pet, JSON, IO[bytes]], **kwargs: Any) -> _models.Pet: + """Update a dog as a pet. + + :param pet: Is one of the following types: Pet, JSON, IO[bytes] Required. + :type pet: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet or JSON or IO[bytes] + :return: Pet. The Pet is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Pet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Pet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(pet, (IOBase, bytes)): + _content = pet + else: + _content = json.dumps(pet, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pet_operations_update_dog_as_pet_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Pet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DogOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~specs.azure.clientgenerator.core.hierarchybuilding.HierarchyBuildingClient`'s + :attr:`dog_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HierarchyBuildingClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_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 update_dog_as_dog( + self, dog: _models.Dog, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_dog(self, dog: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_dog_as_dog( + self, dog: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Required. + :type dog: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_dog_as_dog(self, dog: Union[_models.Dog, JSON, IO[bytes]], **kwargs: Any) -> _models.Dog: + """Update a dog as a dog. + + :param dog: Is one of the following types: Dog, JSON, IO[bytes] Required. + :type dog: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog or JSON or IO[bytes] + :return: Dog. The Dog is compatible with MutableMapping + :rtype: ~specs.azure.clientgenerator.core.hierarchybuilding.models.Dog + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(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.Dog] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(dog, (IOBase, bytes)): + _content = dog + else: + _content = json.dumps(dog, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_dog_operations_update_dog_as_dog_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._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.Dog, 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-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_patch.py new file mode 100644 index 0000000000..8bcb627aa4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/py.typed b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/py.typed new file mode 100644 index 0000000000..e5aff4f83a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py new file mode 100644 index 0000000000..d18fda044c --- /dev/null +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py @@ -0,0 +1,50 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +from specs.azure.clientgenerator.core.hierarchybuilding.aio import HierarchyBuildingClient +from specs.azure.clientgenerator.core.hierarchybuilding.models import ( + Pet, + Dog, +) + + +@pytest.fixture +async def client(): + async with HierarchyBuildingClient() as client: + yield client + + +# ========== test for spector ========== + + +@pytest.mark.asyncio +async def test_update_pet_as_pet(client: HierarchyBuildingClient): + resp = Pet(name="Buddy", trained=True) + assert await client.pet_operations.update_pet_as_pet(Pet(name="Buddy", trained=True)) == resp + + +@pytest.mark.asyncio +async def test_update_dog_as_pet(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert await client.pet_operations.update_dog_as_pet(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp + + +@pytest.mark.asyncio +async def test_update_pet_as_animal(client: HierarchyBuildingClient): + resp = Pet(name="Buddy", trained=True) + assert await client.animal_operations.update_pet_as_animal(Pet(name="Buddy", trained=True)) == resp + + +@pytest.mark.asyncio +async def test_update_dog_as_animal(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert await client.animal_operations.update_dog_as_animal(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp + + +@pytest.mark.asyncio +async def test_update_dog_as_dog(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert await client.dog_operations.update_dog_as_dog(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp diff --git a/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_hierrarchy_building.py b/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_hierrarchy_building.py new file mode 100644 index 0000000000..f11314f6e9 --- /dev/null +++ b/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_hierrarchy_building.py @@ -0,0 +1,45 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +from specs.azure.clientgenerator.core.hierarchybuilding import HierarchyBuildingClient +from specs.azure.clientgenerator.core.hierarchybuilding.models import ( + Pet, + Dog, +) + + +@pytest.fixture +def client(): + with HierarchyBuildingClient() as client: + yield client + + +# ========== test for spector ========== + + +def test_update_pet_as_pet(client: HierarchyBuildingClient): + resp = Pet(name="Buddy", trained=True) + assert client.pet_operations.update_pet_as_pet(Pet(name="Buddy", trained=True)) == resp + + +def test_update_dog_as_pet(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert client.pet_operations.update_dog_as_pet(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp + + +def test_update_pet_as_animal(client: HierarchyBuildingClient): + resp = Pet(name="Buddy", trained=True) + assert client.animal_operations.update_pet_as_animal(Pet(name="Buddy", trained=True)) == resp + + +def test_update_dog_as_animal(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert client.animal_operations.update_dog_as_animal(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp + + +def test_update_dog_as_dog(client: HierarchyBuildingClient): + resp = Dog(name="Rex", trained=True, breed="German Shepherd") + assert client.dog_operations.update_dog_as_dog(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp diff --git a/packages/typespec-python/test/azure/requirements.txt b/packages/typespec-python/test/azure/requirements.txt index 126d6cb66d..bca078e805 100644 --- a/packages/typespec-python/test/azure/requirements.txt +++ b/packages/typespec-python/test/azure/requirements.txt @@ -8,6 +8,7 @@ azure-mgmt-core==1.6.0 -e ./generated/azure-client-generator-core-client-initialization -e ./generated/azure-client-generator-core-deserialize-empty-string-as-null -e ./generated/azure-client-generator-core-flatten-property +-e ./generated/azure-client-generator-core-hierarchy-building -e ./generated/azure-client-generator-core-usage -e ./generated/azure-client-generator-core-override -e ./generated/azure-client-generator-core-client-location From 548e96f70200590d38db46bda1e4cdfe9be287a4 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 11 Aug 2025 18:39:18 +0800 Subject: [PATCH 09/24] black --- ..._azure_client_generator_core_hierrarchy_building_async.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py index d18fda044c..b940b639fe 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_hierrarchy_building_async.py @@ -41,7 +41,10 @@ async def test_update_pet_as_animal(client: HierarchyBuildingClient): @pytest.mark.asyncio async def test_update_dog_as_animal(client: HierarchyBuildingClient): resp = Dog(name="Rex", trained=True, breed="German Shepherd") - assert await client.animal_operations.update_dog_as_animal(Dog(name="Rex", trained=True, breed="German Shepherd")) == resp + assert ( + await client.animal_operations.update_dog_as_animal(Dog(name="Rex", trained=True, breed="German Shepherd")) + == resp + ) @pytest.mark.asyncio From 44d7aff84b859bc1be21706231f44c5450a33c99 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 06:08:24 +0000 Subject: [PATCH 10/24] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 91e95095cb..d53fdff979 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 1e4467c8c6..8c9decbc71 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From b0be08ac66868760232dcc4f2c290415e53f9b48 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 06:09:21 +0000 Subject: [PATCH 11/24] Update dependencies (2025-08-14 06:09:21) --- pnpm-lock.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0d15b2d001..9d61b6b169 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1677,9 +1677,9 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz} - version: 0.15.1 + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz} + version: 0.15.2 engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.59.0 <1.0.0' @@ -6460,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIwMzQ2My9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.1.tgz(6gtvfxfythggrmyik6oqzxhslm)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm)': dependencies: '@azure-tools/typespec-autorest': 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) From 8a8b83262cbc8aef805cbd7cf82e950bdba9e1d6 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 06:14:15 +0000 Subject: [PATCH 12/24] Regenerate for typespec-python (2025-08-14 06:14:15) --- .../authentication-api-key/pyproject.toml | 4 +- .../authentication-http-custom/pyproject.toml | 4 +- .../authentication-oauth2/pyproject.toml | 4 +- .../authentication-union/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../core/access/models/_models.py | 4 + .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../hierarchybuilding/_utils/model_base.py | 2 +- .../core/hierarchybuilding/models/_models.py | 6 + .../operations/_operations.py | 1 - .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/azure-core-basic/pyproject.toml | 4 +- .../azure-core-lro-rpc/pyproject.toml | 4 +- .../azure-core-lro-standard/pyproject.toml | 4 +- .../generated/azure-core-model/pyproject.toml | 4 +- .../generated/azure-core-page/pyproject.toml | 4 +- .../azure-core-scalar/pyproject.toml | 4 +- .../azure-core-traits/pyproject.toml | 4 +- .../azure-encode-duration/pyproject.toml | 4 +- .../azure-example-basic/pyproject.toml | 4 +- .../azure-payload-pageable/pyproject.toml | 4 +- .../commonproperties/models/_models.py | 41 +++++++ .../pyproject.toml | 6 +- .../pyproject.toml | 6 +- .../pyproject.toml | 6 +- .../operationtemplates/models/_models.py | 41 +++++++ .../pyproject.toml | 6 +- .../resources/models/_models.py | 104 +++++++++++++++++- .../pyproject.toml | 6 +- .../pyproject.toml | 4 +- .../generated/client-namespace/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/client-naming/pyproject.toml | 4 +- .../generated/client-overload/pyproject.toml | 4 +- .../client-structure-default/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/encode-bytes/pyproject.toml | 4 +- .../generated/encode-datetime/pyproject.toml | 4 +- .../generated/encode-duration/pyproject.toml | 4 +- .../generated/encode-numeric/pyproject.toml | 4 +- .../generation-subdir/apiview-properties.json | 11 ++ .../subdir/_generated/models/_models.py | 2 + .../generation-subdir/pyproject.toml | 4 +- .../headasbooleanfalse/pyproject.toml | 4 +- .../headasbooleantrue/pyproject.toml | 4 +- .../generated/parameters-basic/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/parameters-path/pyproject.toml | 4 +- .../parameters-spread/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../payload-json-merge-patch/pyproject.toml | 4 +- .../payload-media-type/pyproject.toml | 4 +- .../payload-multipart/pyproject.toml | 4 +- .../generated/payload-pageable/pyproject.toml | 4 +- .../generated/payload-xml/pyproject.toml | 4 +- .../resiliency-srv-driven1/pyproject.toml | 4 +- .../resiliency-srv-driven2/pyproject.toml | 4 +- .../response-status-code-range/pyproject.toml | 4 +- .../azure/generated/routes/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../server-path-multiple/pyproject.toml | 4 +- .../server-path-single/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../server-versions-versioned/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/special-words/pyproject.toml | 4 +- .../generated/streaming-jsonl/pyproject.toml | 4 +- .../generated/typetest-array/pyproject.toml | 4 +- .../typetest-dictionary/pyproject.toml | 4 +- .../typetest-enum-extensible/pyproject.toml | 4 +- .../typetest-enum-fixed/pyproject.toml | 4 +- .../typetest-model-empty/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../model/enumdiscriminator/models/_models.py | 4 + .../pyproject.toml | 4 +- .../nesteddiscriminator/models/_models.py | 12 ++ .../pyproject.toml | 4 +- .../model/notdiscriminated/models/_models.py | 6 + .../typetest-model-recursive/pyproject.toml | 4 +- .../model/recursive/models/_models.py | 2 + .../pyproject.toml | 4 +- .../singlediscriminator/models/_models.py | 10 ++ .../typetest-model-usage/pyproject.toml | 4 +- .../typetest-model-visibility/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../additionalproperties/models/_models.py | 16 +++ .../typetest-property-nullable/pyproject.toml | 4 +- .../typetest-property-optional/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../generated/typetest-scalar/pyproject.toml | 4 +- .../generated/typetest-union/pyproject.toml | 4 +- .../generated/versioning-added/pyproject.toml | 4 +- .../versioning-madeoptional/pyproject.toml | 4 +- .../versioning-removed/pyproject.toml | 4 +- .../versioning-renamedfrom/pyproject.toml | 4 +- .../pyproject.toml | 4 +- .../versioning-typechangedfrom/pyproject.toml | 4 +- .../authentication-api-key/pyproject.toml | 2 +- .../authentication-http-custom/pyproject.toml | 2 +- .../authentication-oauth2/pyproject.toml | 2 +- .../authentication-union/pyproject.toml | 2 +- .../generated/encode-bytes/pyproject.toml | 2 +- .../generated/encode-datetime/pyproject.toml | 2 +- .../generated/encode-duration/pyproject.toml | 2 +- .../generated/encode-numeric/pyproject.toml | 2 +- .../subdir/_generated/models/_models.py | 2 + .../generation-subdir/pyproject.toml | 2 +- .../headasbooleanfalse/pyproject.toml | 2 +- .../headasbooleantrue/pyproject.toml | 2 +- .../generated/parameters-basic/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../generated/parameters-path/pyproject.toml | 2 +- .../parameters-spread/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../payload-json-merge-patch/pyproject.toml | 2 +- .../payload-media-type/pyproject.toml | 2 +- .../payload-multipart/pyproject.toml | 2 +- .../generated/payload-pageable/pyproject.toml | 2 +- .../generated/payload-xml/pyproject.toml | 2 +- .../response-status-code-range/pyproject.toml | 2 +- .../unbranded/generated/routes/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../server-path-multiple/pyproject.toml | 2 +- .../server-path-single/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../server-versions-versioned/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../generated/special-words/pyproject.toml | 2 +- .../generated/streaming-jsonl/pyproject.toml | 2 +- .../generated/typetest-array/pyproject.toml | 2 +- .../typetest-dictionary/pyproject.toml | 2 +- .../typetest-enum-extensible/pyproject.toml | 2 +- .../typetest-enum-fixed/pyproject.toml | 2 +- .../typetest-model-empty/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../model/enumdiscriminator/models/_models.py | 4 + .../pyproject.toml | 2 +- .../nesteddiscriminator/models/_models.py | 12 ++ .../pyproject.toml | 2 +- .../model/notdiscriminated/models/_models.py | 6 + .../typetest-model-recursive/pyproject.toml | 2 +- .../model/recursive/models/_models.py | 2 + .../pyproject.toml | 2 +- .../singlediscriminator/models/_models.py | 10 ++ .../typetest-model-usage/pyproject.toml | 2 +- .../typetest-model-visibility/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../additionalproperties/models/_models.py | 16 +++ .../typetest-property-nullable/pyproject.toml | 2 +- .../typetest-property-optional/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../generated/typetest-scalar/pyproject.toml | 2 +- .../generated/typetest-union/pyproject.toml | 2 +- .../generated/versioning-added/pyproject.toml | 2 +- .../versioning-madeoptional/pyproject.toml | 2 +- .../versioning-removed/pyproject.toml | 2 +- .../versioning-renamedfrom/pyproject.toml | 2 +- .../pyproject.toml | 2 +- .../versioning-typechangedfrom/pyproject.toml | 2 +- 172 files changed, 557 insertions(+), 251 deletions(-) create mode 100644 packages/typespec-python/test/azure/generated/generation-subdir/apiview-properties.json diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/pyproject.toml b/packages/typespec-python/test/azure/generated/authentication-api-key/pyproject.toml index a3cacf4a74..e64a5fbaf0 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "authentication.apikey._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/pyproject.toml b/packages/typespec-python/test/azure/generated/authentication-http-custom/pyproject.toml index 4a835f70b0..c46a1d37e1 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "authentication.http.custom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/pyproject.toml b/packages/typespec-python/test/azure/generated/authentication-oauth2/pyproject.toml index 11869a9073..7753cdf238 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "authentication.oauth2._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/authentication-union/pyproject.toml b/packages/typespec-python/test/azure/generated/authentication-union/pyproject.toml index 42535e68a6..d1a9a1059b 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/authentication-union/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "authentication.union._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/pyproject.toml index 88f83b4387..8a1276e114 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.access._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ 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/models/_models.py index 46c58e3393..a7c47f31b3 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/models/_models.py @@ -196,6 +196,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OuterModel(BaseModel): """Used in internal operations, should be generated but not exported. + :ivar name: Required. + :vartype name: str :ivar inner: Required. :vartype inner: ~specs.azure.clientgenerator.core.access.models._models.InnerModel """ @@ -281,6 +283,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RealModel(AbstractModel, discriminator="real"): """Used in internal operations, should be generated but not exported. + :ivar name: Required. + :vartype name: str :ivar kind: Required. Default value is "real". :vartype kind: str """ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-initialization/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-initialization/pyproject.toml index c20c30ce81..dcfd892809 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-initialization/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-initialization/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.clientinitialization._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-location/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-location/pyproject.toml index a16fabf3c4..3bfc121fd5 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-location/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-client-location/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.clientlocation._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-deserialize-empty-string-as-null/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-deserialize-empty-string-as-null/pyproject.toml index f61389f7be..c80a457f8a 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-deserialize-empty-string-as-null/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-deserialize-empty-string-as-null/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.emptystring._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/pyproject.toml index e2eedf1caa..8f77e5c6d8 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.flattenproperty._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml index 283f61a91a..d237ccfc27 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.hierarchybuilding._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py index e9ac32aaf9..c62e7e7784 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py index 2a85dd117c..5de3dd32d0 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py @@ -56,6 +56,8 @@ class Pet(Animal, discriminator="pet"): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Dog + :ivar name: Name of the animal. Required. + :vartype name: str :ivar kind: Required. Default value is "pet". :vartype kind: str :ivar trained: Whether the pet is trained. Required. @@ -91,6 +93,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Dog(Pet, discriminator="dog"): """Dog. + :ivar name: Name of the animal. Required. + :vartype name: str + :ivar trained: Whether the pet is trained. Required. + :vartype trained: bool :ivar kind: Required. Default value is "dog". :vartype kind: str :ivar breed: The breed of the dog. Required. diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py index d3922db855..ed8afd7ecd 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-override/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-override/pyproject.toml index b96d77e34e..5bf8dd6433 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-override/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-override/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.override._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/pyproject.toml index 4deb28db03..26fe40d21d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.clientgenerator.core.usage._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-basic/pyproject.toml index 531d7bc936..a4a90605e8 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.basic._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/pyproject.toml index 53e187141c..287610ac85 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.lro.rpc._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/pyproject.toml index 4994a3fe57..b5af20ab51 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.lro.standard._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-model/pyproject.toml index 9f8523e3f9..4f7345c67d 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-model/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.model._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-page/pyproject.toml index 245952d3f5..d0b633b290 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-page/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.page._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-scalar/pyproject.toml index 5cd8bb8653..106b62d33b 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.scalar._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-core-traits/pyproject.toml index 2f96a74844..7ddd19b5d5 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.core.traits._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-encode-duration/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-encode-duration/pyproject.toml index f917bb7d76..14b067ee3d 100644 --- a/packages/typespec-python/test/azure/generated/azure-encode-duration/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-encode-duration/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.encode.duration._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-example-basic/pyproject.toml index fc5953b445..60a18091e7 100644 --- a/packages/typespec-python/test/azure/generated/azure-example-basic/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.example.basic._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-payload-pageable/pyproject.toml index 67347bd823..d5232477e3 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specs.azure.payload.pageable._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py index 7a6d38093e..d70afed1b7 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/azure/resourcemanager/commonproperties/models/_models.py @@ -164,6 +164,17 @@ class Resource(_Model): class TrackedResource(Resource): """Tracked Resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -198,6 +209,21 @@ class ConfidentialResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.commonproperties.models.ConfidentialResourceProperties @@ -370,6 +396,21 @@ class ManagedIdentityTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.commonproperties.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.commonproperties.models.ManagedIdentityTrackedResourceProperties diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/pyproject.toml index 11a19123f3..877e462eac 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-resourcemanager-commonproperties" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Resourcemanager Commonproperties Client Library for Python" +description = "Microsoft Azure Commonproperties Management Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.resourcemanager.commonproperties._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-large-header/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-resource-manager-large-header/pyproject.toml index 6999e5fdef..50966293d5 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-large-header/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-large-header/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-resourcemanager-largeheader" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Resourcemanager Largeheader Client Library for Python" +description = "Microsoft Azure Largeheader Management Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.resourcemanager.largeheader._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/pyproject.toml index 2ad8034a1d..ae4ee04a8a 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-resourcemanager-nonresource" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Resourcemanager Nonresource Client Library for Python" +description = "Microsoft Azure Nonresource Management Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.resourcemanager.nonresource._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py index db3f48bbd6..3ec1d43d86 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/models/_models.py @@ -474,6 +474,17 @@ class Resource(_Model): class TrackedResource(Resource): """Tracked Resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -508,6 +519,21 @@ class Order(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.operationtemplates.models.OrderProperties """ @@ -646,6 +672,21 @@ class Widget(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.operationtemplates.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.operationtemplates.models.WidgetProperties """ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/pyproject.toml index 14a309d321..13ed98b7f8 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-resourcemanager-operationtemplates" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Resourcemanager Operationtemplates Client Library for Python" +description = "Microsoft Azure Operationtemplates Management Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.resourcemanager.operationtemplates._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py index 384a3ab05e..59578127d9 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/models/_models.py @@ -118,13 +118,37 @@ class Resource(_Model): class ExtensionResource(Resource): - """The base extension resource.""" + """The base extension resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData + """ class ExtensionsResource(ExtensionResource): """Concrete extension resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.ExtensionsResourceProperties """ @@ -189,13 +213,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ProxyResource(Resource): - """Proxy Resource.""" + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData + """ class LocationResource(ProxyResource): """Concrete proxy resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.LocationResourceProperties """ @@ -262,6 +310,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class NestedProxyResource(ProxyResource): """Nested child of Top Level Tracked Resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.NestedProxyResourceProperties """ @@ -361,6 +420,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TrackedResource(Resource): """Tracked Resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -395,6 +465,21 @@ class SingletonTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.SingletonTrackedResourceProperties """ @@ -531,6 +616,21 @@ class TopLevelTrackedResource(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.resources.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.resourcemanager.resources.models.TopLevelTrackedResourceProperties """ diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/pyproject.toml index df422150f2..c322f41fb3 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-resourcemanager-resources" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Resourcemanager Resources Client Library for Python" +description = "Microsoft Azure Resources Management Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 4 - Beta", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.resourcemanager.resources._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/pyproject.toml b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/pyproject.toml index 450dd544cb..a69161c043 100644 --- a/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/azure-special-headers-client-request-id/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.specialheaders.xmsclientrequestid._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-namespace/pyproject.toml b/packages/typespec-python/test/azure/generated/client-namespace/pyproject.toml index eaab29f79c..30ceb12635 100644 --- a/packages/typespec-python/test/azure/generated/client-namespace/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-namespace/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.clientnamespace._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-naming-enum-conflict/pyproject.toml b/packages/typespec-python/test/azure/generated/client-naming-enum-conflict/pyproject.toml index 5823ade48f..97f6f849ec 100644 --- a/packages/typespec-python/test/azure/generated/client-naming-enum-conflict/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-naming-enum-conflict/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.naming.enumconflict._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-naming/pyproject.toml b/packages/typespec-python/test/azure/generated/client-naming/pyproject.toml index b26f8a88e1..1d4729e03e 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-naming/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.naming._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-overload/pyproject.toml b/packages/typespec-python/test/azure/generated/client-overload/pyproject.toml index 7d10877006..6babd69cb7 100644 --- a/packages/typespec-python/test/azure/generated/client-overload/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-overload/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.overload._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/pyproject.toml b/packages/typespec-python/test/azure/generated/client-structure-default/pyproject.toml index c1bb457fb1..afcd3910fe 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-structure-default/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.structure.service._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/pyproject.toml b/packages/typespec-python/test/azure/generated/client-structure-multiclient/pyproject.toml index 65e6002fed..43b084b5e3 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.structure.multiclient._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/pyproject.toml b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/pyproject.toml index 618a7cba4b..994bfe5f79 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.structure.renamedoperation._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/pyproject.toml b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/pyproject.toml index aefeac58e6..30e515ff65 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "client.structure.twooperationgroup._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/pyproject.toml b/packages/typespec-python/test/azure/generated/encode-bytes/pyproject.toml index 0a19c7f50b..705e18d73e 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/encode-bytes/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "encode.bytes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/pyproject.toml b/packages/typespec-python/test/azure/generated/encode-datetime/pyproject.toml index 48badb503b..d3dc23e1a5 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/encode-datetime/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "encode.datetime._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/encode-duration/pyproject.toml b/packages/typespec-python/test/azure/generated/encode-duration/pyproject.toml index b4a6e299a8..11a3e44c43 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/encode-duration/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "encode.duration._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/pyproject.toml b/packages/typespec-python/test/azure/generated/encode-numeric/pyproject.toml index d243a979b2..6b9d6952e0 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/encode-numeric/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "encode.numeric._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/generation-subdir/apiview-properties.json b/packages/typespec-python/test/azure/generated/generation-subdir/apiview-properties.json new file mode 100644 index 0000000000..46a422c625 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/generation-subdir/apiview-properties.json @@ -0,0 +1,11 @@ +{ + "CrossLanguagePackageId": "Type.Model.Inheritance.Recursive", + "CrossLanguageDefinitionId": { + "generation.subdir.models.Element": "Type.Model.Inheritance.Recursive.Element", + "generation.subdir.models.Extension": "Type.Model.Inheritance.Recursive.Extension", + "generation.subdir.RecursiveClient.put": "Type.Model.Inheritance.Recursive.put", + "generation.subdir.aio.RecursiveClient.put": "Type.Model.Inheritance.Recursive.put", + "generation.subdir.RecursiveClient.get": "Type.Model.Inheritance.Recursive.get", + "generation.subdir.aio.RecursiveClient.get": "Type.Model.Inheritance.Recursive.get" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py b/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py index cb1aca3ddd..92a359538c 100644 --- a/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py +++ b/packages/typespec-python/test/azure/generated/generation-subdir/generation/subdir/_generated/models/_models.py @@ -47,6 +47,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. + :ivar extension: + :vartype extension: list[~generation.subdir._generated.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/azure/generated/generation-subdir/pyproject.toml b/packages/typespec-python/test/azure/generated/generation-subdir/pyproject.toml index 667e4fa8c1..15b4ddf504 100644 --- a/packages/typespec-python/test/azure/generated/generation-subdir/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/generation-subdir/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "generation.subdir._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/pyproject.toml b/packages/typespec-python/test/azure/generated/headasbooleanfalse/pyproject.toml index aa1816191d..08c5a7de16 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "headasbooleanfalse._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/pyproject.toml b/packages/typespec-python/test/azure/generated/headasbooleantrue/pyproject.toml index 50200a7f11..cb50ad481a 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "headasbooleantrue._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/pyproject.toml b/packages/typespec-python/test/azure/generated/parameters-basic/pyproject.toml index 93a2781447..4c3fdb3702 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/parameters-basic/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "parameters.basic._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/pyproject.toml b/packages/typespec-python/test/azure/generated/parameters-body-optionality/pyproject.toml index 07309fb35c..9650182c54 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "parameters.bodyoptionality._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/pyproject.toml b/packages/typespec-python/test/azure/generated/parameters-collection-format/pyproject.toml index e6be5dc819..2a8ba32af5 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "parameters.collectionformat._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/parameters-path/pyproject.toml b/packages/typespec-python/test/azure/generated/parameters-path/pyproject.toml index df20e61e6c..c9b61afb75 100644 --- a/packages/typespec-python/test/azure/generated/parameters-path/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/parameters-path/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "parameters.path._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/pyproject.toml b/packages/typespec-python/test/azure/generated/parameters-spread/pyproject.toml index f03a137b83..89693a3788 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/parameters-spread/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "parameters.spread._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-content-negotiation/pyproject.toml index 2479685a39..3f912a22da 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.contentnegotiation._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/pyproject.toml index 016c7e3735..51fb16f1bf 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.jsonmergepatch._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-media-type/pyproject.toml index 8c7043e219..14934d9677 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-media-type/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.mediatype._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-multipart/pyproject.toml index 484d6edbd0..2027739d3f 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-multipart/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.multipart._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-pageable/pyproject.toml index f83446daea..ac74cc0915 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-pageable/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.pageable._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/payload-xml/pyproject.toml b/packages/typespec-python/test/azure/generated/payload-xml/pyproject.toml index 64c23808b1..69512f93bb 100644 --- a/packages/typespec-python/test/azure/generated/payload-xml/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/payload-xml/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "payload.xml._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/pyproject.toml b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/pyproject.toml index 201d1f2cc9..eb7ec7137f 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "resiliency.srv.driven1._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/pyproject.toml b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/pyproject.toml index 908a4d9716..d29025e49a 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "resiliency.srv.driven2._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/response-status-code-range/pyproject.toml b/packages/typespec-python/test/azure/generated/response-status-code-range/pyproject.toml index 782db3c622..e430067843 100644 --- a/packages/typespec-python/test/azure/generated/response-status-code-range/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/response-status-code-range/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "response.statuscoderange._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/routes/pyproject.toml b/packages/typespec-python/test/azure/generated/routes/pyproject.toml index 8686017ec2..dd97483bd2 100644 --- a/packages/typespec-python/test/azure/generated/routes/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/routes/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "routes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/pyproject.toml b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/pyproject.toml index d7cf30a247..071e366b3a 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "serialization.encodedname.json._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/pyproject.toml b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/pyproject.toml index 04422010b5..3114bf6ffb 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "server.endpoint.notdefined._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/pyproject.toml b/packages/typespec-python/test/azure/generated/server-path-multiple/pyproject.toml index 25ec5b764c..556ad25ef0 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "server.path.multiple._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/server-path-single/pyproject.toml b/packages/typespec-python/test/azure/generated/server-path-single/pyproject.toml index 909f3c6ad1..d087c57300 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/server-path-single/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "server.path.single._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/pyproject.toml b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/pyproject.toml index 6fdfe6a807..a9efa2f171 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "server.versions.notversioned._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/pyproject.toml b/packages/typespec-python/test/azure/generated/server-versions-versioned/pyproject.toml index bea773e70e..be1465c20a 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "server.versions.versioned._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/pyproject.toml b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/pyproject.toml index 3127799452..ab1e769901 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specialheaders.conditionalrequest._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/pyproject.toml b/packages/typespec-python/test/azure/generated/special-headers-repeatability/pyproject.toml index a6b661f2d2..f8fc2bed1c 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specialheaders.repeatability._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/special-words/pyproject.toml b/packages/typespec-python/test/azure/generated/special-words/pyproject.toml index 5be797d497..f6ebd38122 100644 --- a/packages/typespec-python/test/azure/generated/special-words/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/special-words/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "specialwords._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/streaming-jsonl/pyproject.toml b/packages/typespec-python/test/azure/generated/streaming-jsonl/pyproject.toml index 920262f2d0..de6631d663 100644 --- a/packages/typespec-python/test/azure/generated/streaming-jsonl/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/streaming-jsonl/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "streaming.jsonl._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-array/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-array/pyproject.toml index 5b8d864f70..4fc8aaeef7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-array/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.array._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-dictionary/pyproject.toml index 0647e9ab0e..0d61eec3e1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.dictionary._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/pyproject.toml index e300a90461..f8ba6b449d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.enum.extensible._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/pyproject.toml index e1373f3576..7133579b4c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.enum.fixed._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-empty/pyproject.toml index 5a9f7f3d77..1fd43de5c1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.empty._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/pyproject.toml index a84b898875..71318aad05 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.enumdiscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index 6482dcb9e2..8e336fcc40 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -54,6 +54,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cobra(Snake, discriminator="cobra"): """Cobra model. + :ivar length: Length of the snake. Required. + :vartype length: int :ivar kind: discriminator property. Required. Species cobra :vartype kind: str or ~typetest.model.enumdiscriminator.models.COBRA """ @@ -120,6 +122,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Golden(Dog, discriminator="golden"): """Golden dog model. + :ivar weight: Weight of the dog. Required. + :vartype weight: int :ivar kind: discriminator property. Required. Species golden :vartype kind: str or ~typetest.model.enumdiscriminator.models.GOLDEN """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/pyproject.toml index 816cfcf927..300aeac910 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.nesteddiscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index 6bacfe5b70..995a669a60 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -60,6 +60,8 @@ class Shark(Fish, discriminator="shark"): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GoblinShark, SawShark + :ivar age: Required. + :vartype age: int :ivar kind: Required. Default value is "shark". :vartype kind: str :ivar sharktype: Required. Default value is None. @@ -95,6 +97,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GoblinShark(Shark, discriminator="goblin"): """The third level model GoblinShark in polymorphic multiple levels inheritance. + :ivar age: Required. + :vartype age: int + :ivar kind: Required. Default value is "shark". + :vartype kind: str :ivar sharktype: Required. Default value is "goblin". :vartype sharktype: str """ @@ -126,6 +132,8 @@ class Salmon(Fish, discriminator="salmon"): """The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances. + :ivar age: Required. + :vartype age: int :ivar kind: Required. Default value is "salmon". :vartype kind: str :ivar friends: @@ -167,6 +175,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SawShark(Shark, discriminator="saw"): """The third level model SawShark in polymorphic multiple levels inheritance. + :ivar age: Required. + :vartype age: int + :ivar kind: Required. Default value is "shark". + :vartype kind: str :ivar sharktype: Required. Default value is "saw". :vartype sharktype: str """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/pyproject.toml index 51cf11dffa..c8a5bb99f6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.notdiscriminated._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py index b559473844..be87f1155d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py @@ -43,6 +43,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cat(Pet): """The second level model in the normal multiple levels inheritance. + :ivar name: Required. + :vartype name: str :ivar age: Required. :vartype age: int """ @@ -72,6 +74,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Siamese(Cat): """The third level model in the normal multiple levels inheritance. + :ivar name: Required. + :vartype name: str + :ivar age: Required. + :vartype age: int :ivar smart: Required. :vartype smart: bool """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-recursive/pyproject.toml index 602606e980..37e8e88542 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.recursive._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py index e9311e0098..b891d4c569 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py @@ -47,6 +47,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. + :ivar extension: + :vartype extension: list[~typetest.model.recursive.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/pyproject.toml index a4b3e874c1..c6a6c5ac4d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.singlediscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index cb197e2409..af80a99339 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -95,6 +95,8 @@ class Eagle(Bird, discriminator="eagle"): """The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "eagle". :vartype kind: str :ivar friends: @@ -136,6 +138,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Goose(Bird, discriminator="goose"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "goose". :vartype kind: str """ @@ -165,6 +169,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SeaGull(Bird, discriminator="seagull"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "seagull". :vartype kind: str """ @@ -194,6 +200,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Sparrow(Bird, discriminator="sparrow"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "sparrow". :vartype kind: str """ @@ -223,6 +231,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TRex(Dinosaur, discriminator="t-rex"): """The second level legacy model in polymorphic single level inheritance. + :ivar size: Required. + :vartype size: int :ivar kind: Required. Default value is "t-rex". :vartype kind: str """ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-usage/pyproject.toml index 04102e6110..eaa91cdd3f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.usage._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-model-visibility/pyproject.toml index 418c8a4297..110db895e4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.model.visibility._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/pyproject.toml index 3da4fe9e93..447a83cb6d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.property.additionalproperties._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index 9af90398e3..8af11c406f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -49,6 +49,8 @@ class DifferentSpreadFloatDerived(DifferentSpreadFloatRecord): """The model extends from a model that spread Record with the different known property type. + :ivar name: The id property. Required. + :vartype name: str :ivar derived_prop: The index property. Required. :vartype derived_prop: float """ @@ -107,6 +109,8 @@ class DifferentSpreadModelArrayDerived(DifferentSpreadModelArrayRecord): """The model extends from a model that spread Record with the different known property type. + :ivar known_prop: Required. + :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: list[~typetest.property.additionalproperties.models.ModelForRecord] """ @@ -167,6 +171,8 @@ class DifferentSpreadModelDerived(DifferentSpreadModelRecord): """The model extends from a model that spread Record with the different known property type. + :ivar known_prop: Required. + :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: ~typetest.property.additionalproperties.models.ModelForRecord """ @@ -227,6 +233,8 @@ class DifferentSpreadStringDerived(DifferentSpreadStringRecord): """The model extends from a model that spread Record with the different known property type. + :ivar id: The name property. Required. + :vartype id: float :ivar derived_prop: The index property. Required. :vartype derived_prop: str """ @@ -400,6 +408,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExtendsUnknownAdditionalPropertiesDerived(ExtendsUnknownAdditionalProperties): # pylint: disable=name-too-long """The model extends from a type that extends from Record. + :ivar name: The name property. Required. + :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -473,6 +483,8 @@ class ExtendsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. + :ivar name: The name property. Required. + :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -656,6 +668,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IsUnknownAdditionalPropertiesDerived(IsUnknownAdditionalProperties): """The model extends from a type that is Record type. + :ivar name: The name property. Required. + :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -729,6 +743,8 @@ class IsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. + :ivar name: The name property. Required. + :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-property-nullable/pyproject.toml index 5423d08f46..a470e2af45 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.property.nullable._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-property-optional/pyproject.toml index 0c92018b14..8e1e7d1f9c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.property.optional._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/pyproject.toml index 3408b71484..40787f03eb 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.property.valuetypes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-scalar/pyproject.toml index 43a519c544..7528a1fd10 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.scalar._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/typetest-union/pyproject.toml b/packages/typespec-python/test/azure/generated/typetest-union/pyproject.toml index 47808459e4..74fe0136d0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/typetest-union/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "typetest.union._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-added/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-added/pyproject.toml index 0614ada0b4..2f23f1fc5f 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-added/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.added._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-madeoptional/pyproject.toml index 556b78996f..b1b012ca6d 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.madeoptional._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-removed/pyproject.toml index 27ab4394e2..a81c0e17fe 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-removed/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.removed._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/pyproject.toml index 941d4352af..47b3eb3df2 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.renamedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/pyproject.toml index ba08ea80ff..a1417aebca 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.returntypechangedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/pyproject.toml b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/pyproject.toml index 77fe1868d3..d5a4892887 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/pyproject.toml +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "versioning.typechangedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/pyproject.toml b/packages/typespec-python/test/unbranded/generated/authentication-api-key/pyproject.toml index 9d1a19912c..fc15913e05 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "authentication.apikey._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/pyproject.toml b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/pyproject.toml index cbc16bda38..1f99fea00b 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "authentication.http.custom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/pyproject.toml b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/pyproject.toml index fbf52b9dd3..8ba2be9cab 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "authentication.oauth2._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/pyproject.toml b/packages/typespec-python/test/unbranded/generated/authentication-union/pyproject.toml index 23b3737ccd..8e8ced831a 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "authentication.union._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/pyproject.toml b/packages/typespec-python/test/unbranded/generated/encode-bytes/pyproject.toml index e7427787f5..5da7bb0f54 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "encode.bytes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/pyproject.toml b/packages/typespec-python/test/unbranded/generated/encode-datetime/pyproject.toml index 303bea32b9..099b13d4f9 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "encode.datetime._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/pyproject.toml b/packages/typespec-python/test/unbranded/generated/encode-duration/pyproject.toml index 03aa2285a4..c3959805b8 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "encode.duration._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/pyproject.toml b/packages/typespec-python/test/unbranded/generated/encode-numeric/pyproject.toml index 7ec0fdb1e0..bf553c9a4a 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "encode.numeric._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py b/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py index b5181f64ab..1159b391e9 100644 --- a/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/generation-subdir/generation/subdir/_generated/models/_models.py @@ -41,6 +41,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. + :ivar extension: + :vartype extension: list[~generation.subdir._generated.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/unbranded/generated/generation-subdir/pyproject.toml b/packages/typespec-python/test/unbranded/generated/generation-subdir/pyproject.toml index 788c37bec6..a4fa2d4dcb 100644 --- a/packages/typespec-python/test/unbranded/generated/generation-subdir/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/generation-subdir/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "generation.subdir._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/pyproject.toml b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/pyproject.toml index cbf079106a..51e5f9c4e2 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "headasbooleanfalse._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/pyproject.toml b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/pyproject.toml index d2fa2a96e0..3769d15c1e 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "headasbooleantrue._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/parameters-basic/pyproject.toml b/packages/typespec-python/test/unbranded/generated/parameters-basic/pyproject.toml index 53773f384b..d2e7fd1451 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-basic/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/parameters-basic/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "parameters.basic._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/pyproject.toml b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/pyproject.toml index dfad29d3ed..114093bcdb 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "parameters.bodyoptionality._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/pyproject.toml b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/pyproject.toml index 25e8731ba7..bf9d1a1d91 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "parameters.collectionformat._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/parameters-path/pyproject.toml b/packages/typespec-python/test/unbranded/generated/parameters-path/pyproject.toml index 8e1a2e6bc9..dbf9a96b78 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-path/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/parameters-path/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "parameters.path._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/pyproject.toml b/packages/typespec-python/test/unbranded/generated/parameters-spread/pyproject.toml index 94f298f00f..4071cbf0c9 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "parameters.spread._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/pyproject.toml index 78b1770582..d670ed74b7 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.contentnegotiation._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/pyproject.toml index ee986bac23..6d0c247c22 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.jsonmergepatch._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-media-type/pyproject.toml index 06b12d8c2c..ada434922d 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.mediatype._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-multipart/pyproject.toml index 53a9096a64..78379bed91 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.multipart._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-pageable/pyproject.toml index 8cad1628d2..1432a744ad 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.pageable._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/payload-xml/pyproject.toml b/packages/typespec-python/test/unbranded/generated/payload-xml/pyproject.toml index e322970c66..41e6fea6cb 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-xml/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/payload-xml/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "payload.xml._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/response-status-code-range/pyproject.toml b/packages/typespec-python/test/unbranded/generated/response-status-code-range/pyproject.toml index 736cc50dce..cb5fb09294 100644 --- a/packages/typespec-python/test/unbranded/generated/response-status-code-range/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/response-status-code-range/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "response.statuscoderange._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/routes/pyproject.toml b/packages/typespec-python/test/unbranded/generated/routes/pyproject.toml index 7e1e649e72..e0f5f6f6a2 100644 --- a/packages/typespec-python/test/unbranded/generated/routes/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/routes/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "routes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/pyproject.toml b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/pyproject.toml index 44904af2ef..72cc3ca28a 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "serialization.encodedname.json._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/pyproject.toml b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/pyproject.toml index 603a22ec0a..0c46a6ffea 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "server.endpoint.notdefined._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/pyproject.toml b/packages/typespec-python/test/unbranded/generated/server-path-multiple/pyproject.toml index 91cea51677..c9f38b4ff6 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "server.path.multiple._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/pyproject.toml b/packages/typespec-python/test/unbranded/generated/server-path-single/pyproject.toml index f6429fa52e..321fbdad5f 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "server.path.single._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/pyproject.toml b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/pyproject.toml index 84144e568e..ef2a062475 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "server.versions.notversioned._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/pyproject.toml b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/pyproject.toml index 85c133ce40..b0d6c67073 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "server.versions.versioned._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/pyproject.toml b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/pyproject.toml index 60950931cf..94e4044ddf 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "specialheaders.conditionalrequest._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/pyproject.toml b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/pyproject.toml index 9ad71a2fa6..4580c52542 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "specialheaders.repeatability._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/special-words/pyproject.toml b/packages/typespec-python/test/unbranded/generated/special-words/pyproject.toml index 5586882eff..d3032ad194 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/special-words/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "specialwords._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/streaming-jsonl/pyproject.toml b/packages/typespec-python/test/unbranded/generated/streaming-jsonl/pyproject.toml index 3a3e8bfdd0..5b6a161f9e 100644 --- a/packages/typespec-python/test/unbranded/generated/streaming-jsonl/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/streaming-jsonl/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "streaming.jsonl._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-array/pyproject.toml index 6e81e94509..ea795e387b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.array._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/pyproject.toml index ecda89bd78..964ee77704 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.dictionary._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/pyproject.toml index 0b37796f56..da6034930d 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.enum.extensible._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/pyproject.toml index e189b50c41..279217be8c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.enum.fixed._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/pyproject.toml index 3b7d7889bf..db254f43c5 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.empty._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/pyproject.toml index 1ebc822e1a..812db32fc2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.enumdiscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py index 5354db5f5b..56f6bbf30c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/models/_models.py @@ -48,6 +48,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cobra(Snake, discriminator="cobra"): """Cobra model. + :ivar length: Length of the snake. Required. + :vartype length: int :ivar kind: discriminator property. Required. Species cobra :vartype kind: str or ~typetest.model.enumdiscriminator.models.COBRA """ @@ -114,6 +116,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Golden(Dog, discriminator="golden"): """Golden dog model. + :ivar weight: Weight of the dog. Required. + :vartype weight: int :ivar kind: discriminator property. Required. Species golden :vartype kind: str or ~typetest.model.enumdiscriminator.models.GOLDEN """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/pyproject.toml index 7783ee8e0f..dcc15aec5a 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.nesteddiscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py index ccfb525aa8..26cc0d055b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/models/_models.py @@ -54,6 +54,8 @@ class Shark(Fish, discriminator="shark"): You probably want to use the sub-classes and not this class directly. Known sub-classes are: GoblinShark, SawShark + :ivar age: Required. + :vartype age: int :ivar kind: Required. Default value is "shark". :vartype kind: str :ivar sharktype: Required. Default value is None. @@ -89,6 +91,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GoblinShark(Shark, discriminator="goblin"): """The third level model GoblinShark in polymorphic multiple levels inheritance. + :ivar age: Required. + :vartype age: int + :ivar kind: Required. Default value is "shark". + :vartype kind: str :ivar sharktype: Required. Default value is "goblin". :vartype sharktype: str """ @@ -120,6 +126,8 @@ class Salmon(Fish, discriminator="salmon"): """The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances. + :ivar age: Required. + :vartype age: int :ivar kind: Required. Default value is "salmon". :vartype kind: str :ivar friends: @@ -161,6 +169,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SawShark(Shark, discriminator="saw"): """The third level model SawShark in polymorphic multiple levels inheritance. + :ivar age: Required. + :vartype age: int + :ivar kind: Required. Default value is "shark". + :vartype kind: str :ivar sharktype: Required. Default value is "saw". :vartype sharktype: str """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/pyproject.toml index a80a568047..0d49441651 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.notdiscriminated._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py index 482d954df8..838cd399fb 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/models/_models.py @@ -37,6 +37,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Cat(Pet): """The second level model in the normal multiple levels inheritance. + :ivar name: Required. + :vartype name: str :ivar age: Required. :vartype age: int """ @@ -66,6 +68,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Siamese(Cat): """The third level model in the normal multiple levels inheritance. + :ivar name: Required. + :vartype name: str + :ivar age: Required. + :vartype age: int :ivar smart: Required. :vartype smart: bool """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/pyproject.toml index e621e78ec9..5711576f84 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.recursive._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py index bf90e918c4..1daf06af3f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/models/_models.py @@ -41,6 +41,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Extension(Element): """extension. + :ivar extension: + :vartype extension: list[~typetest.model.recursive.models.Extension] :ivar level: Required. :vartype level: int """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/pyproject.toml index 8f06a52ad6..be9570a912 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.singlediscriminator._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py index e22b4a5c4d..47a3a68b8b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/models/_models.py @@ -89,6 +89,8 @@ class Eagle(Bird, discriminator="eagle"): """The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "eagle". :vartype kind: str :ivar friends: @@ -130,6 +132,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Goose(Bird, discriminator="goose"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "goose". :vartype kind: str """ @@ -159,6 +163,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SeaGull(Bird, discriminator="seagull"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "seagull". :vartype kind: str """ @@ -188,6 +194,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Sparrow(Bird, discriminator="sparrow"): """The second level model in polymorphic single level inheritance. + :ivar wingspan: Required. + :vartype wingspan: int :ivar kind: Required. Default value is "sparrow". :vartype kind: str """ @@ -217,6 +225,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TRex(Dinosaur, discriminator="t-rex"): """The second level legacy model in polymorphic single level inheritance. + :ivar size: Required. + :vartype size: int :ivar kind: Required. Default value is "t-rex". :vartype kind: str """ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/pyproject.toml index bb80d7ebf2..baaea4403f 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.usage._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/pyproject.toml index e387f9ef10..9ef0dc53a2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.model.visibility._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/pyproject.toml index 8cd7b1802a..c123e00690 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.property.additionalproperties._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py index a4774d51e2..7161cbc245 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py @@ -43,6 +43,8 @@ class DifferentSpreadFloatDerived(DifferentSpreadFloatRecord): """The model extends from a model that spread Record with the different known property type. + :ivar name: The id property. Required. + :vartype name: str :ivar derived_prop: The index property. Required. :vartype derived_prop: float """ @@ -101,6 +103,8 @@ class DifferentSpreadModelArrayDerived(DifferentSpreadModelArrayRecord): """The model extends from a model that spread Record with the different known property type. + :ivar known_prop: Required. + :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: list[~typetest.property.additionalproperties.models.ModelForRecord] """ @@ -161,6 +165,8 @@ class DifferentSpreadModelDerived(DifferentSpreadModelRecord): """The model extends from a model that spread Record with the different known property type. + :ivar known_prop: Required. + :vartype known_prop: str :ivar derived_prop: The index property. Required. :vartype derived_prop: ~typetest.property.additionalproperties.models.ModelForRecord """ @@ -221,6 +227,8 @@ class DifferentSpreadStringDerived(DifferentSpreadStringRecord): """The model extends from a model that spread Record with the different known property type. + :ivar id: The name property. Required. + :vartype id: float :ivar derived_prop: The index property. Required. :vartype derived_prop: str """ @@ -394,6 +402,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExtendsUnknownAdditionalPropertiesDerived(ExtendsUnknownAdditionalProperties): # pylint: disable=name-too-long """The model extends from a type that extends from Record. + :ivar name: The name property. Required. + :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -467,6 +477,8 @@ class ExtendsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. + :ivar name: The name property. Required. + :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. @@ -650,6 +662,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IsUnknownAdditionalPropertiesDerived(IsUnknownAdditionalProperties): """The model extends from a type that is Record type. + :ivar name: The name property. Required. + :vartype name: str :ivar index: The index property. Required. :vartype index: int :ivar age: The age property. @@ -723,6 +737,8 @@ class IsUnknownAdditionalPropertiesDiscriminatedDerived( ): # pylint: disable=name-too-long """The derived discriminated type. + :ivar name: The name property. Required. + :vartype name: str :ivar kind: Required. Default value is "derived". :vartype kind: str :ivar index: The index property. Required. diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/pyproject.toml index 04555582a1..9c701f3a86 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.property.nullable._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/pyproject.toml index 5240ba4543..f8750363c2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.property.optional._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/pyproject.toml index 68851db66a..f31ef8a56e 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.property.valuetypes._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-scalar/pyproject.toml index c613b0cccd..d6d7464941 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.scalar._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/pyproject.toml b/packages/typespec-python/test/unbranded/generated/typetest-union/pyproject.toml index 3a01447a3b..911eadb7f5 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "typetest.union._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-added/pyproject.toml index bfa8eb3ee6..0695a6052f 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.added._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/pyproject.toml index 58f1db77e6..d8eedffde8 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.madeoptional._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-removed/pyproject.toml index fa3a4be36f..5ba79a8bcc 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.removed._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/pyproject.toml index 8c536efe48..5dc66c298a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.renamedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/pyproject.toml index dd80908ed7..21577e8181 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.returntypechangedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/pyproject.toml b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/pyproject.toml index c22d3af178..8119b4e84d 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/pyproject.toml +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/pyproject.toml @@ -34,7 +34,7 @@ dynamic = [ [tool.setuptools.dynamic] version = {attr = "versioning.typechangedfrom._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ From 7108cf5eb9b7304f324a3b6bf78e011911cba9ca Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 06:31:01 +0000 Subject: [PATCH 13/24] Regenerate for autorest.python (2025-08-14 06:31:01) --- .../mgmt/test => }/apiview-properties.json | 0 .../test/azure-mgmt-test/setup.py | 2 +- .../_generated => }/apiview-properties.json | 0 .../sample/v1/apiview-properties.json | 19 ---------------- .../sample/v2/apiview-properties.json | 17 -------------- .../sample/v3/apiview-properties.json | 22 ------------------- .../PackageModeBatch/pyproject.toml | 6 ++--- .../PackageModeDataPlane/pyproject.toml | 6 ++--- .../PackageModeMgmtPlane/pyproject.toml | 6 ++--- .../multiapi/v0/apiview-properties.json | 10 --------- .../multiapi/v1/apiview-properties.json | 19 ---------------- .../multiapi/v2/apiview-properties.json | 17 -------------- .../multiapi/v3/apiview-properties.json | 22 ------------------- .../v1/apiview-properties.json | 19 ---------------- .../v2/apiview-properties.json | 17 -------------- .../v3/apiview-properties.json | 22 ------------------- .../v1/apiview-properties.json | 8 ------- .../v2/apiview-properties.json | 8 ------- .../v1/apiview-properties.json | 19 ---------------- .../v2/apiview-properties.json | 17 -------------- .../v3/apiview-properties.json | 22 ------------------- .../v1/apiview-properties.json | 19 ---------------- .../v2/apiview-properties.json | 17 -------------- .../v3/apiview-properties.json | 22 ------------------- .../v1/apiview-properties.json | 19 ---------------- .../v2/apiview-properties.json | 17 -------------- .../v3/apiview-properties.json | 22 ------------------- .../v0/apiview-properties.json | 10 --------- .../v1/apiview-properties.json | 19 ---------------- .../submodule/v1/apiview-properties.json | 19 ---------------- .../submodule/v2/apiview-properties.json | 17 -------------- .../submodule/v3/apiview-properties.json | 22 ------------------- .../InternalOperation/pyproject.toml | 4 ++-- .../PackageModeDataPlane/pyproject.toml | 4 ++-- 34 files changed, 14 insertions(+), 475 deletions(-) rename packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/{azure/mgmt/test => }/apiview-properties.json (100%) rename packages/autorest.python/samples/specification/azure-test/test/azure-test/azure/{test/_generated => }/apiview-properties.json (100%) delete mode 100644 packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/apiview-properties.json delete mode 100644 packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/apiview-properties.json delete mode 100644 packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/apiview-properties.json delete mode 100644 packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/apiview-properties.json diff --git a/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/apiview-properties.json b/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json similarity index 100% rename from packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/apiview-properties.json rename to packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json diff --git a/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/setup.py b/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/setup.py index 9d8eb7c5e3..e104896169 100644 --- a/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/setup.py +++ b/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/setup.py @@ -13,7 +13,7 @@ PACKAGE_NAME = "azure-mgmt-test" -PACKAGE_PPRINT_NAME = "Azure Mgmt Test" +PACKAGE_PPRINT_NAME = "Test Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace("-", "/") diff --git a/packages/autorest.python/samples/specification/azure-test/test/azure-test/azure/test/_generated/apiview-properties.json b/packages/autorest.python/samples/specification/azure-test/test/azure-test/azure/apiview-properties.json similarity index 100% rename from packages/autorest.python/samples/specification/azure-test/test/azure-test/azure/test/_generated/apiview-properties.json rename to packages/autorest.python/samples/specification/azure-test/test/azure-test/azure/apiview-properties.json diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/apiview-properties.json b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/apiview-properties.json deleted file mode 100644 index 237149dbc0..0000000000 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "azure.multiapi.sample.v1.models.Error": null, - "azure.multiapi.sample.v1.models.PagingResult": null, - "azure.multiapi.sample.v1.models.Product": null, - "azure.multiapi.sample.v1.models.TestLroAndPagingOptions": null, - "azure.multiapi.sample.v1.MultiapiServiceClient.test_one": null, - "azure.multiapi.sample.v1.aio.MultiapiServiceClient.test_one": null, - "azure.multiapi.sample.v1.MultiapiServiceClient.begin_test_lro": null, - "azure.multiapi.sample.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "azure.multiapi.sample.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "azure.multiapi.sample.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "azure.multiapi.sample.v1.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v1.aio.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v1.operations.OperationGroupOneOperations.test_two": null, - "azure.multiapi.sample.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/apiview-properties.json b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/apiview-properties.json deleted file mode 100644 index 616b4235e1..0000000000 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "azure.multiapi.sample.v2.models.Error": null, - "azure.multiapi.sample.v2.models.ModelTwo": null, - "azure.multiapi.sample.v2.MultiapiServiceClient.test_one": null, - "azure.multiapi.sample.v2.aio.MultiapiServiceClient.test_one": null, - "azure.multiapi.sample.v2.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v2.aio.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v2.operations.OperationGroupOneOperations.test_two": null, - "azure.multiapi.sample.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "azure.multiapi.sample.v2.operations.OperationGroupOneOperations.test_three": null, - "azure.multiapi.sample.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "azure.multiapi.sample.v2.operations.OperationGroupTwoOperations.test_four": null, - "azure.multiapi.sample.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/apiview-properties.json b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/apiview-properties.json deleted file mode 100644 index a2952fef09..0000000000 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "azure.multiapi.sample.v3.models.Error": null, - "azure.multiapi.sample.v3.models.ModelThree": null, - "azure.multiapi.sample.v3.models.PagingResult": null, - "azure.multiapi.sample.v3.models.SourcePath": null, - "azure.multiapi.sample.v3.models.ContentType": null, - "azure.multiapi.sample.v3.MultiapiServiceClient.test_paging": null, - "azure.multiapi.sample.v3.aio.MultiapiServiceClient.test_paging": null, - "azure.multiapi.sample.v3.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v3.aio.MultiapiServiceClient.test_different_calls": null, - "azure.multiapi.sample.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "azure.multiapi.sample.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "azure.multiapi.sample.v3.operations.OperationGroupOneOperations.test_two": null, - "azure.multiapi.sample.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "azure.multiapi.sample.v3.operations.OperationGroupTwoOperations.test_four": null, - "azure.multiapi.sample.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "azure.multiapi.sample.v3.operations.OperationGroupTwoOperations.test_five": null, - "azure.multiapi.sample.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/pyproject.toml b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/pyproject.toml index 809f91c5c2..b6603e7d3b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/pyproject.toml +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-packagemode-batch" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Package Mode Batch Mgmt Plane Client Library for Python" +description = "Microsoft Azure Azure Package Mode Batch Mgmt Plane Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.packagemode.batch._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml index ce1e890d9d..074f567c5e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-packagemode-dataplane" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Package Mode Data Plane Client Library for Python" +description = "Microsoft Azure Azure Package Mode Data Plane Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.packagemode.dataplane._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/pyproject.toml b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/pyproject.toml index f4e100dd38..b505597c14 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/pyproject.toml +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/pyproject.toml @@ -14,7 +14,7 @@ name = "azure-package-mode" authors = [ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] -description = "Microsoft Corporation Azure Package Mode Client Library for Python" +description = "Microsoft Azure Azure Package Mode Client Library for Python" license = "MIT" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "azure.package.mode._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/apiview-properties.json deleted file mode 100644 index 0fc2d90d5c..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/apiview-properties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapi.v0.models.Error": null, - "multiapi.v0.models.PagingResult": null, - "multiapi.v0.models.Product": null, - "multiapi.v0.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v0.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/apiview-properties.json deleted file mode 100644 index d71abb978d..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapi.v1.models.Error": null, - "multiapi.v1.models.PagingResult": null, - "multiapi.v1.models.Product": null, - "multiapi.v1.models.TestLroAndPagingOptions": null, - "multiapi.v1.MultiapiServiceClient.test_one": null, - "multiapi.v1.aio.MultiapiServiceClient.test_one": null, - "multiapi.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapi.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapi.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapi.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapi.v1.MultiapiServiceClient.test_different_calls": null, - "multiapi.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapi.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/apiview-properties.json deleted file mode 100644 index 410ef24eb6..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapi.v2.models.Error": null, - "multiapi.v2.models.ModelTwo": null, - "multiapi.v2.MultiapiServiceClient.test_one": null, - "multiapi.v2.aio.MultiapiServiceClient.test_one": null, - "multiapi.v2.MultiapiServiceClient.test_different_calls": null, - "multiapi.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapi.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapi.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapi.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapi.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/apiview-properties.json deleted file mode 100644 index a7486f7900..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapi.v3.models.Error": null, - "multiapi.v3.models.ModelThree": null, - "multiapi.v3.models.PagingResult": null, - "multiapi.v3.models.SourcePath": null, - "multiapi.v3.models.ContentType": null, - "multiapi.v3.MultiapiServiceClient.test_paging": null, - "multiapi.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapi.v3.MultiapiServiceClient.test_different_calls": null, - "multiapi.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapi.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapi.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapi.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapi.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapi.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapi.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapi.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/apiview-properties.json deleted file mode 100644 index b520015333..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapicredentialdefaultpolicy.v1.models.Error": null, - "multiapicredentialdefaultpolicy.v1.models.PagingResult": null, - "multiapicredentialdefaultpolicy.v1.models.Product": null, - "multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions": null, - "multiapicredentialdefaultpolicy.v1.MultiapiServiceClient.test_one": null, - "multiapicredentialdefaultpolicy.v1.aio.MultiapiServiceClient.test_one": null, - "multiapicredentialdefaultpolicy.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapicredentialdefaultpolicy.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapicredentialdefaultpolicy.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapicredentialdefaultpolicy.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapicredentialdefaultpolicy.v1.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapicredentialdefaultpolicy.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/apiview-properties.json deleted file mode 100644 index 24e7bfa6c9..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapicredentialdefaultpolicy.v2.models.Error": null, - "multiapicredentialdefaultpolicy.v2.models.ModelTwo": null, - "multiapicredentialdefaultpolicy.v2.MultiapiServiceClient.test_one": null, - "multiapicredentialdefaultpolicy.v2.aio.MultiapiServiceClient.test_one": null, - "multiapicredentialdefaultpolicy.v2.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapicredentialdefaultpolicy.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapicredentialdefaultpolicy.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapicredentialdefaultpolicy.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapicredentialdefaultpolicy.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapicredentialdefaultpolicy.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/apiview-properties.json deleted file mode 100644 index 12d8f074b6..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapicredentialdefaultpolicy.v3.models.Error": null, - "multiapicredentialdefaultpolicy.v3.models.ModelThree": null, - "multiapicredentialdefaultpolicy.v3.models.PagingResult": null, - "multiapicredentialdefaultpolicy.v3.models.SourcePath": null, - "multiapicredentialdefaultpolicy.v3.models.ContentType": null, - "multiapicredentialdefaultpolicy.v3.MultiapiServiceClient.test_paging": null, - "multiapicredentialdefaultpolicy.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapicredentialdefaultpolicy.v3.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapicredentialdefaultpolicy.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapicredentialdefaultpolicy.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapicredentialdefaultpolicy.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapicredentialdefaultpolicy.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapicredentialdefaultpolicy.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapicredentialdefaultpolicy.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapicredentialdefaultpolicy.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapicredentialdefaultpolicy.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/apiview-properties.json deleted file mode 100644 index 40c8c60e07..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/apiview-properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapicustombaseurl.v1.models.Error": null, - "multiapicustombaseurl.v1.MultiapiCustomBaseUrlServiceClient.test": null, - "multiapicustombaseurl.v1.aio.MultiapiCustomBaseUrlServiceClient.test": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/apiview-properties.json deleted file mode 100644 index 1736b39690..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/apiview-properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapicustombaseurl.v2.models.Error": null, - "multiapicustombaseurl.v2.MultiapiCustomBaseUrlServiceClient.test": null, - "multiapicustombaseurl.v2.aio.MultiapiCustomBaseUrlServiceClient.test": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/apiview-properties.json deleted file mode 100644 index 8ed165e411..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapidataplane.v1.models.Error": null, - "multiapidataplane.v1.models.PagingResult": null, - "multiapidataplane.v1.models.Product": null, - "multiapidataplane.v1.models.TestLroAndPagingOptions": null, - "multiapidataplane.v1.MultiapiServiceClient.test_one": null, - "multiapidataplane.v1.aio.MultiapiServiceClient.test_one": null, - "multiapidataplane.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapidataplane.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapidataplane.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapidataplane.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapidataplane.v1.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapidataplane.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/apiview-properties.json deleted file mode 100644 index af56f9e0c9..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapidataplane.v2.models.Error": null, - "multiapidataplane.v2.models.ModelTwo": null, - "multiapidataplane.v2.MultiapiServiceClient.test_one": null, - "multiapidataplane.v2.aio.MultiapiServiceClient.test_one": null, - "multiapidataplane.v2.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapidataplane.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapidataplane.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapidataplane.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapidataplane.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapidataplane.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/apiview-properties.json deleted file mode 100644 index 9240a543d1..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapidataplane.v3.models.Error": null, - "multiapidataplane.v3.models.ModelThree": null, - "multiapidataplane.v3.models.PagingResult": null, - "multiapidataplane.v3.models.SourcePath": null, - "multiapidataplane.v3.models.ContentType": null, - "multiapidataplane.v3.MultiapiServiceClient.test_paging": null, - "multiapidataplane.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapidataplane.v3.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapidataplane.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapidataplane.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapidataplane.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapidataplane.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapidataplane.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapidataplane.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapidataplane.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapidataplane.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/apiview-properties.json deleted file mode 100644 index d3e3f514eb..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapikeywordonly.v1.models.Error": null, - "multiapikeywordonly.v1.models.PagingResult": null, - "multiapikeywordonly.v1.models.Product": null, - "multiapikeywordonly.v1.models.TestLroAndPagingOptions": null, - "multiapikeywordonly.v1.MultiapiServiceClient.test_one": null, - "multiapikeywordonly.v1.aio.MultiapiServiceClient.test_one": null, - "multiapikeywordonly.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapikeywordonly.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapikeywordonly.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapikeywordonly.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapikeywordonly.v1.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapikeywordonly.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/apiview-properties.json deleted file mode 100644 index 1a08f77e20..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapikeywordonly.v2.models.Error": null, - "multiapikeywordonly.v2.models.ModelTwo": null, - "multiapikeywordonly.v2.MultiapiServiceClient.test_one": null, - "multiapikeywordonly.v2.aio.MultiapiServiceClient.test_one": null, - "multiapikeywordonly.v2.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapikeywordonly.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapikeywordonly.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapikeywordonly.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapikeywordonly.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapikeywordonly.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/apiview-properties.json deleted file mode 100644 index 2ed98f96f9..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapikeywordonly.v3.models.Error": null, - "multiapikeywordonly.v3.models.ModelThree": null, - "multiapikeywordonly.v3.models.PagingResult": null, - "multiapikeywordonly.v3.models.SourcePath": null, - "multiapikeywordonly.v3.models.ContentType": null, - "multiapikeywordonly.v3.MultiapiServiceClient.test_paging": null, - "multiapikeywordonly.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapikeywordonly.v3.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapikeywordonly.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapikeywordonly.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapikeywordonly.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapikeywordonly.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapikeywordonly.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapikeywordonly.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapikeywordonly.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapikeywordonly.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/apiview-properties.json deleted file mode 100644 index 89f4acbf01..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapinoasync.v1.models.Error": null, - "multiapinoasync.v1.models.PagingResult": null, - "multiapinoasync.v1.models.Product": null, - "multiapinoasync.v1.models.TestLroAndPagingOptions": null, - "multiapinoasync.v1.MultiapiServiceClient.test_one": null, - "multiapinoasync.v1.aio.MultiapiServiceClient.test_one": null, - "multiapinoasync.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapinoasync.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapinoasync.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapinoasync.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapinoasync.v1.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapinoasync.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/apiview-properties.json deleted file mode 100644 index d78340f5d4..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapinoasync.v2.models.Error": null, - "multiapinoasync.v2.models.ModelTwo": null, - "multiapinoasync.v2.MultiapiServiceClient.test_one": null, - "multiapinoasync.v2.aio.MultiapiServiceClient.test_one": null, - "multiapinoasync.v2.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapinoasync.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapinoasync.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapinoasync.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapinoasync.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapinoasync.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/apiview-properties.json deleted file mode 100644 index c73a759cc4..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapinoasync.v3.models.Error": null, - "multiapinoasync.v3.models.ModelThree": null, - "multiapinoasync.v3.models.PagingResult": null, - "multiapinoasync.v3.models.SourcePath": null, - "multiapinoasync.v3.models.ContentType": null, - "multiapinoasync.v3.MultiapiServiceClient.test_paging": null, - "multiapinoasync.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapinoasync.v3.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapinoasync.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapinoasync.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapinoasync.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapinoasync.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapinoasync.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapinoasync.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapinoasync.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapinoasync.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/apiview-properties.json deleted file mode 100644 index f8be0161e5..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/apiview-properties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapisecurity.v0.models.Error": null, - "multiapisecurity.v0.models.PagingResult": null, - "multiapisecurity.v0.models.Product": null, - "multiapisecurity.v0.operations.OperationGroupOneOperations.test_two": null, - "multiapisecurity.v0.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/apiview-properties.json deleted file mode 100644 index 70aa67a6ee..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapisecurity.v1.models.Error": null, - "multiapisecurity.v1.models.PagingResult": null, - "multiapisecurity.v1.models.Product": null, - "multiapisecurity.v1.models.TestLroAndPagingOptions": null, - "multiapisecurity.v1.MultiapiServiceClient.test_one": null, - "multiapisecurity.v1.aio.MultiapiServiceClient.test_one": null, - "multiapisecurity.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapisecurity.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapisecurity.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapisecurity.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapisecurity.v1.MultiapiServiceClient.test_different_calls": null, - "multiapisecurity.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapisecurity.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapisecurity.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/apiview-properties.json deleted file mode 100644 index e7f939f4f2..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/apiview-properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapiwithsubmodule.submodule.v1.models.Error": null, - "multiapiwithsubmodule.submodule.v1.models.PagingResult": null, - "multiapiwithsubmodule.submodule.v1.models.Product": null, - "multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions": null, - "multiapiwithsubmodule.submodule.v1.MultiapiServiceClient.test_one": null, - "multiapiwithsubmodule.submodule.v1.aio.MultiapiServiceClient.test_one": null, - "multiapiwithsubmodule.submodule.v1.MultiapiServiceClient.begin_test_lro": null, - "multiapiwithsubmodule.submodule.v1.aio.MultiapiServiceClient.begin_test_lro": null, - "multiapiwithsubmodule.submodule.v1.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapiwithsubmodule.submodule.v1.aio.MultiapiServiceClient.begin_test_lro_and_paging": null, - "multiapiwithsubmodule.submodule.v1.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v1.aio.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v1.operations.OperationGroupOneOperations.test_two": null, - "multiapiwithsubmodule.submodule.v1.aio.operations.OperationGroupOneOperations.test_two": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/apiview-properties.json deleted file mode 100644 index af5cf69d96..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/apiview-properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapiwithsubmodule.submodule.v2.models.Error": null, - "multiapiwithsubmodule.submodule.v2.models.ModelTwo": null, - "multiapiwithsubmodule.submodule.v2.MultiapiServiceClient.test_one": null, - "multiapiwithsubmodule.submodule.v2.aio.MultiapiServiceClient.test_one": null, - "multiapiwithsubmodule.submodule.v2.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v2.aio.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v2.operations.OperationGroupOneOperations.test_two": null, - "multiapiwithsubmodule.submodule.v2.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapiwithsubmodule.submodule.v2.operations.OperationGroupOneOperations.test_three": null, - "multiapiwithsubmodule.submodule.v2.aio.operations.OperationGroupOneOperations.test_three": null, - "multiapiwithsubmodule.submodule.v2.operations.OperationGroupTwoOperations.test_four": null, - "multiapiwithsubmodule.submodule.v2.aio.operations.OperationGroupTwoOperations.test_four": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/apiview-properties.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/apiview-properties.json deleted file mode 100644 index 5f75db9b8c..0000000000 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/apiview-properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "CrossLanguagePackageId": null, - "CrossLanguageDefinitionId": { - "multiapiwithsubmodule.submodule.v3.models.Error": null, - "multiapiwithsubmodule.submodule.v3.models.ModelThree": null, - "multiapiwithsubmodule.submodule.v3.models.PagingResult": null, - "multiapiwithsubmodule.submodule.v3.models.SourcePath": null, - "multiapiwithsubmodule.submodule.v3.models.ContentType": null, - "multiapiwithsubmodule.submodule.v3.MultiapiServiceClient.test_paging": null, - "multiapiwithsubmodule.submodule.v3.aio.MultiapiServiceClient.test_paging": null, - "multiapiwithsubmodule.submodule.v3.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v3.aio.MultiapiServiceClient.test_different_calls": null, - "multiapiwithsubmodule.submodule.v3.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupOneOperations.test_operation_group_paging": null, - "multiapiwithsubmodule.submodule.v3.operations.OperationGroupOneOperations.test_two": null, - "multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupOneOperations.test_two": null, - "multiapiwithsubmodule.submodule.v3.operations.OperationGroupTwoOperations.test_four": null, - "multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupTwoOperations.test_four": null, - "multiapiwithsubmodule.submodule.v3.operations.OperationGroupTwoOperations.test_five": null, - "multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupTwoOperations.test_five": null - } -} \ No newline at end of file diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/pyproject.toml b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/pyproject.toml index 9b2ec0a4be..a6113f9219 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/pyproject.toml +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "internaloperation._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml index 3c701f1d21..0a1fffc482 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/pyproject.toml @@ -40,11 +40,11 @@ dynamic = [ ] [project.urls] -repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk" +repository = "https://github.com/Azure/azure-sdk-for-python" [tool.setuptools.dynamic] version = {attr = "packagemode._version.VERSION"} -readme = {file = ["README.md"], content-type = "text/markdown"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ From 605992620cc6b0e6cca1925aec1d74979dbc01b5 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 08:12:06 +0000 Subject: [PATCH 14/24] Update dependencies --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 4250f73315..b0b2651bbe 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.15.2", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} +} \ No newline at end of file diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 0d42f26d2e..c087950529 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.15.2", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -103,4 +103,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file From 32611aa57a07e0b4bd1376ace1b347548d3ad8a8 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 08:13:02 +0000 Subject: [PATCH 15/24] Update dependencies (2025-08-14 08:13:02) --- pnpm-lock.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1516f0d870..9d61b6b169 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.15.2 - version: 0.15.2(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.15.2 - version: 0.15.2(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1677,8 +1677,9 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@0.15.2': - resolution: {integrity: sha512-tgbdsqB212HYeAjHk+w3wdsZ6wLmvIZbFD92qdZBRovuk6p6bMJAcHFoN17x3NV2T4NTeKWqBpsY9wlj5Cn8gw==} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz} + version: 0.15.2 engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.59.0 <1.0.0' @@ -6459,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@0.15.2(6gtvfxfythggrmyik6oqzxhslm)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxODQ4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm)': dependencies: '@azure-tools/typespec-autorest': 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) From 27381bba9ba664847fd32f544031ab5984a80418 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 14 Aug 2025 08:34:01 +0000 Subject: [PATCH 16/24] Regenerate for autorest.python (2025-08-14 08:34:00) --- .../test/azure-mgmt-test/apiview-properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json b/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json index 8c77517609..94b27fe18a 100644 --- a/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json +++ b/packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/apiview-properties.json @@ -8,4 +8,4 @@ "azure.mgmt.test.operations.HttpSuccessOperations.head404": null, "azure.mgmt.test.aio.operations.HttpSuccessOperations.head404": null } -} +} \ No newline at end of file From 106aeb8571fd0a19c479a3cde9dcdbaded7a5c96 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 15 Aug 2025 11:10:12 +0800 Subject: [PATCH 17/24] add changelog --- ...t-python-multi-layer-discriminator-2025-7-15-11-10-3.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/auto-microsoft-python-multi-layer-discriminator-2025-7-15-11-10-3.md diff --git a/.chronus/changes/auto-microsoft-python-multi-layer-discriminator-2025-7-15-11-10-3.md b/.chronus/changes/auto-microsoft-python-multi-layer-discriminator-2025-7-15-11-10-3.md new file mode 100644 index 0000000000..d6463aebb6 --- /dev/null +++ b/.chronus/changes/auto-microsoft-python-multi-layer-discriminator-2025-7-15-11-10-3.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@azure-tools/typespec-python" +--- + +DPG model supports multi-layer discriminator. \ No newline at end of file From 1d2f6f68151f31b74571d74bc6f8ead856b4f8cf Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 15 Aug 2025 11:11:12 +0800 Subject: [PATCH 18/24] update regenerate.ts --- packages/typespec-python/scripts/eng/regenerate.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 39efbcc0c2..081e44749c 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -23,7 +23,6 @@ interface TspCommand { const SKIP_SPECS = [ "type/union/discriminated", "client-operation-group", - "azure/client-generator-core/api-version", ]; const AZURE_EMITTER_OPTIONS: Record | Record[]> = { From 539b09f71b8424624f96866e67c42c6934dde498 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 15 Aug 2025 11:13:20 +0800 Subject: [PATCH 19/24] Format --- packages/typespec-python/scripts/eng/regenerate.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 081e44749c..c390fe96f7 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -20,10 +20,7 @@ interface TspCommand { } // Add this near the top with other constants -const SKIP_SPECS = [ - "type/union/discriminated", - "client-operation-group", -]; +const SKIP_SPECS = ["type/union/discriminated", "client-operation-group"]; const AZURE_EMITTER_OPTIONS: Record | Record[]> = { "azure/client-generator-core/access": { From 67ca775d13dfb5688b8985c82503d385d360fbe4 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 15 Aug 2025 05:06:49 +0000 Subject: [PATCH 20/24] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 2517425f95..f6b9a2ecf6 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 1875d563da..8a198b078b 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -86,7 +86,7 @@ "@azure-tools/typespec-azure-rulesets": "~0.59.0", "@azure-tools/typespec-autorest": "~0.59.0", "@azure-tools/typespec-client-generator-core": "~0.59.0", - "@azure-tools/azure-http-specs": "0.1.0-alpha.25", + "@azure-tools/azure-http-specs": "0.1.0-alpha.26", "@typespec/http-specs": "0.1.0-alpha.25", "@typespec/spector": "0.1.0-alpha.17", "@typespec/spec-api": "0.1.0-alpha.8", From 66ec9faa6f9530a8397c7f7664739807bc18b0d4 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 15 Aug 2025 05:07:47 +0000 Subject: [PATCH 21/24] Update dependencies (2025-08-15 05:07:47) --- pnpm-lock.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a0f0e8af..bd8234749d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -98,8 +98,8 @@ importers: version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': - specifier: 0.1.0-alpha.25 - version: 0.1.0-alpha.25(tsnbxk7z3h65bhkmgjy2jtqk7m) + specifier: 0.1.0-alpha.26 + version: 0.1.0-alpha.26(tsnbxk7z3h65bhkmgjy2jtqk7m) '@azure-tools/typespec-autorest': specifier: ~0.59.0 version: 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) @@ -209,8 +209,8 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/azure-http-specs@0.1.0-alpha.25': - resolution: {integrity: sha512-fvexvGbDUUcd6su+RCln/hrOosbWYvl1FaycaifX0NVJub/ne492G2dvHLgp2N8rnUJ9uIenXYjHZHYsrjyGHQ==} + '@azure-tools/azure-http-specs@0.1.0-alpha.26': + resolution: {integrity: sha512-GsEQLscGE3K8dFN9P5iOWC4x/hDqNS8qDwzK9cMfIjSodZ3krtJurmjmhhtfyXQvsx0gOo+2xRJ/c56EDfMluw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.59.0 @@ -1677,8 +1677,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz} version: 0.15.2 engines: {node: '>=20.0.0'} peerDependencies: @@ -4866,7 +4866,7 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.25(tsnbxk7z3h65bhkmgjy2jtqk7m)': + '@azure-tools/azure-http-specs@0.1.0-alpha.26(tsnbxk7z3h65bhkmgjy2jtqk7m)': dependencies: '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) '@typespec/compiler': 1.3.0(@types/node@24.1.0) @@ -6460,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIxOTc3Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTIyMzA0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.15.2.tgz(6gtvfxfythggrmyik6oqzxhslm)': dependencies: '@azure-tools/typespec-autorest': 0.59.0(tlfj6gbglsbr5x2lirzpm33h7y) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))) From 808aefa541b8ae6bcd08ef4362cb31bae3c0c4a8 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 2 Sep 2025 15:53:11 -0400 Subject: [PATCH 22/24] regen --- .../hierarchybuilding/_utils/model_base.py | 58 ++++++++++--------- .../hierarchybuilding/_utils/serialization.py | 24 ++++---- .../aio/operations/_operations.py | 4 +- .../core/hierarchybuilding/models/_models.py | 6 +- .../operations/_operations.py | 4 +- 5 files changed, 49 insertions(+), 47 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py index c62e7e7784..12926fa98d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -346,7 +346,7 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: @@ -426,7 +426,7 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. @@ -514,9 +514,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -539,7 +537,7 @@ class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ @@ -624,7 +622,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -639,7 +637,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -681,7 +679,7 @@ def _deserialize(cls, data, exist_discriminators): mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -741,7 +739,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -751,7 +749,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -772,14 +770,14 @@ def _deserialize_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -844,7 +842,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -857,7 +858,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -975,11 +979,11 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -1037,11 +1041,11 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -1058,8 +1062,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1078,9 +1082,9 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) @@ -1169,7 +1173,7 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: wrapped_element = _create_xml_element( meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None @@ -1212,7 +1216,7 @@ def _deserialize_xml( def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1225,7 +1229,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py index eb86ea23c9..e81921cbb0 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -229,12 +227,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py index 7d01201634..7ba62206a3 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/aio/operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -40,7 +40,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] class AnimalOperationsOperations: diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py index 5de3dd32d0..df042fdee4 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/models/_models.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Any, Dict, Literal, Mapping, overload +from typing import Any, Literal, Mapping, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field @@ -25,7 +25,7 @@ class Animal(_Model): :vartype name: str """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) """The kind of animal. Required. Default value is None.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -64,7 +64,7 @@ class Pet(Animal, discriminator="pet"): :vartype trained: bool """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} kind: Literal["pet"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. Default value is \"pet\".""" trained: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py index ed8afd7ecd..fb42496d39 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-hierarchy-building/specs/azure/clientgenerator/core/hierarchybuilding/operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -33,7 +33,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False From 41c8a425b1c3211f84d59e3a73496a2bf570ca1b Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 4 Sep 2025 07:09:52 +0000 Subject: [PATCH 23/24] Update dependencies --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 4c9042cb4e..5ebecff19d 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.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 3830f1980f..f77f78bc6f 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -103,4 +103,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file From b09c392d9e1342a7e73839d3a85ccde170935a4f Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 4 Sep 2025 07:11:58 +0000 Subject: [PATCH 24/24] Update dependencies (2025-09-04 07:11:58) --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 101b777089..1b8729aecc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1677,8 +1677,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.3.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz} version: 0.16.0 engines: {node: '>=20.0.0'} peerDependencies: @@ -6460,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.3.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI4ODIwNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTI5NDY5NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.16.0.tgz(u6ty2hffr3qbaepqntv4k5p2hu)': dependencies: '@azure-tools/typespec-autorest': 0.59.1(4qmm6n6o7ftevfz5poc4nn6iku) '@azure-tools/typespec-azure-core': 0.59.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))))(@typespec/rest@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/http@1.3.0(@typespec/compiler@1.3.0(@types/node@24.1.0))(@typespec/streams@0.73.0(@typespec/compiler@1.3.0(@types/node@24.1.0)))))