Skip to content

Commit 653a94d

Browse files
msyyctadeleshiscai-msft
authored
[http-client-pytho] DPG model supports multi-layer discriminator. (#3169)
* Update dependencies * Update dependencies (2025-08-11 06:39:15) * Regenerate for typespec-python (2025-08-11 06:44:07) * Update dependencies * Update dependencies * Update dependencies (2025-08-11 09:46:14) * Regenerate for typespec-python (2025-08-11 09:51:10) * update * black * Update dependencies * Update dependencies (2025-08-14 06:09:21) * Regenerate for typespec-python (2025-08-14 06:14:15) * Regenerate for autorest.python (2025-08-14 06:31:01) * Update dependencies * Update dependencies (2025-08-14 08:13:02) * Regenerate for autorest.python (2025-08-14 08:34:00) * add changelog * update regenerate.ts * Format * Update dependencies * Update dependencies (2025-08-15 05:07:47) * regen * Update dependencies * Update dependencies (2025-09-04 07:11:58) --------- Co-authored-by: AutoPrFromHttpClientPython <AutoPrFromHttpClientPython> Co-authored-by: tadelesh <[email protected]> Co-authored-by: iscai-msft <[email protected]>
1 parent 91cce2a commit 653a94d

File tree

59 files changed

+6083
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6083
-43
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: feature
3+
packages:
4+
- "@azure-tools/typespec-python"
5+
---
6+
7+
DPG model supports multi-layer discriminator.

packages/autorest.python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
3131
"dependencies": {
32-
"@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",
32+
"@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",
3333
"@autorest/system-requirements": "~1.0.2",
3434
"fs-extra": "~11.2.0",
3535
"tsx": "~4.19.1"
@@ -47,4 +47,4 @@
4747
"requirements.txt",
4848
"generator/"
4949
]
50-
}
50+
}

packages/typespec-python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"js-yaml": "~4.1.0",
6868
"semver": "~7.6.2",
6969
"tsx": "~4.19.1",
70-
"@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",
70+
"@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",
7171
"fs-extra": "~11.2.0"
7272
},
7373
"devDependencies": {
@@ -103,4 +103,4 @@
103103
"chalk": "5.3.0",
104104
"@types/fs-extra": "11.0.4"
105105
}
106-
}
106+
}

packages/typespec-python/scripts/eng/regenerate.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ interface TspCommand {
2020
}
2121

2222
// Add this near the top with other constants
23-
const SKIP_SPECS = [
24-
"type/union/discriminated",
25-
"client-operation-group",
26-
"azure/client-generator-core/hierarchy-building",
27-
];
23+
const SKIP_SPECS = ["type/union/discriminated", "client-operation-group"];
2824

2925
const AZURE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, string>[]> = {
3026
"azure/client-generator-core/access": {
@@ -51,6 +47,9 @@ const AZURE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<stri
5147
"azure/client-generator-core/override": {
5248
namespace: "specs.azure.clientgenerator.core.override",
5349
},
50+
"azure/client-generator-core/hierarchy-building": {
51+
namespace: "specs.azure.clientgenerator.core.hierarchybuilding",
52+
},
5453
"azure/core/basic": {
5554
namespace: "specs.azure.core.basic",
5655
},

packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/models/_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None:
307307
"""
308308

309309
def __init__(self, *args: Any, **kwargs: Any) -> None:
310-
super().__init__(*args, kind="real", **kwargs)
310+
super().__init__(*args, **kwargs)
311+
self.kind = "real" # type: ignore
311312

312313

313314
class SharedModel(_Model):
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (1970-01-01)
4+
5+
- Initial version
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include *.md
2+
include LICENSE
3+
include specs/azure/clientgenerator/core/hierarchybuilding/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include specs/__init__.py
7+
include specs/azure/__init__.py
8+
include specs/azure/clientgenerator/__init__.py
9+
include specs/azure/clientgenerator/core/__init__.py
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Specs Azure Clientgenerator Core Hierarchybuilding client library for Python
2+
<!-- write necessary description of service -->
3+
4+
## Getting started
5+
6+
### Install the package
7+
8+
```bash
9+
python -m pip install specs-azure-clientgenerator-core-hierarchybuilding
10+
```
11+
12+
#### Prequisites
13+
14+
- Python 3.9 or later is required to use this package.
15+
- You need an [Azure subscription][azure_sub] to use this package.
16+
- An existing Specs Azure Clientgenerator Core Hierarchybuilding instance.
17+
18+
19+
## Contributing
20+
21+
This project welcomes contributions and suggestions. Most contributions require
22+
you to agree to a Contributor License Agreement (CLA) declaring that you have
23+
the right to, and actually do, grant us the rights to use your contribution.
24+
For details, visit https://cla.microsoft.com.
25+
26+
When you submit a pull request, a CLA-bot will automatically determine whether
27+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
28+
comment). Simply follow the instructions provided by the bot. You will only
29+
need to do this once across all repos using our CLA.
30+
31+
This project has adopted the
32+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
33+
see the Code of Conduct FAQ or contact [email protected] with any
34+
additional questions or comments.
35+
36+
<!-- LINKS -->
37+
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
38+
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
39+
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
40+
[azure_identity_pip]: https://pypi.org/project/azure-identity/
41+
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
42+
[pip]: https://pypi.org/project/pip/
43+
[azure_sub]: https://azure.microsoft.com/free/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding",
3+
"CrossLanguageDefinitionId": {
4+
"specs.azure.clientgenerator.core.hierarchybuilding.models.Animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Animal",
5+
"specs.azure.clientgenerator.core.hierarchybuilding.models.Pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Pet",
6+
"specs.azure.clientgenerator.core.hierarchybuilding.models.Dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.Dog",
7+
"specs.azure.clientgenerator.core.hierarchybuilding.operations.AnimalOperationsOperations.update_pet_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updatePetAsAnimal",
8+
"specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.AnimalOperationsOperations.update_pet_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updatePetAsAnimal",
9+
"specs.azure.clientgenerator.core.hierarchybuilding.operations.AnimalOperationsOperations.update_dog_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updateDogAsAnimal",
10+
"specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.AnimalOperationsOperations.update_dog_as_animal": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.AnimalOperations.updateDogAsAnimal",
11+
"specs.azure.clientgenerator.core.hierarchybuilding.operations.PetOperationsOperations.update_pet_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updatePetAsPet",
12+
"specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.PetOperationsOperations.update_pet_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updatePetAsPet",
13+
"specs.azure.clientgenerator.core.hierarchybuilding.operations.PetOperationsOperations.update_dog_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updateDogAsPet",
14+
"specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.PetOperationsOperations.update_dog_as_pet": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.PetOperations.updateDogAsPet",
15+
"specs.azure.clientgenerator.core.hierarchybuilding.operations.DogOperationsOperations.update_dog_as_dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.DogOperations.updateDogAsDog",
16+
"specs.azure.clientgenerator.core.hierarchybuilding.aio.operations.DogOperationsOperations.update_dog_as_dog": "_Specs_.Azure.ClientGenerator.Core.HierarchyBuilding.DogOperations.updateDogAsDog"
17+
}
18+
}

0 commit comments

Comments
 (0)