Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6fcbffb
Update dependencies
Aug 11, 2025
575bcd3
Update dependencies (2025-08-11 06:39:15)
Aug 11, 2025
4392b7c
Regenerate for typespec-python (2025-08-11 06:44:07)
Aug 11, 2025
cf5def7
Update dependencies
Aug 11, 2025
8e44a6f
Update dependencies
Aug 11, 2025
aed9f97
Update dependencies (2025-08-11 09:46:14)
Aug 11, 2025
b9e24bd
Regenerate for typespec-python (2025-08-11 09:51:10)
Aug 11, 2025
eeab908
update
Aug 11, 2025
548e96f
black
Aug 11, 2025
44d7aff
Update dependencies
Aug 14, 2025
b0be08a
Update dependencies (2025-08-14 06:09:21)
Aug 14, 2025
8a8b832
Regenerate for typespec-python (2025-08-14 06:14:15)
Aug 14, 2025
7108cf5
Regenerate for autorest.python (2025-08-14 06:31:01)
Aug 14, 2025
2eade48
Merge remote-tracking branch 'origin/main' into auto-microsoft-python…
Aug 14, 2025
6059926
Update dependencies
Aug 14, 2025
32611aa
Update dependencies (2025-08-14 08:13:02)
Aug 14, 2025
27381bb
Regenerate for autorest.python (2025-08-14 08:34:00)
Aug 14, 2025
676bfdc
merge
msyyc Aug 15, 2025
106aeb8
add changelog
msyyc Aug 15, 2025
1d2f6f6
update regenerate.ts
msyyc Aug 15, 2025
539b09f
Format
msyyc Aug 15, 2025
67ca775
Update dependencies
Aug 15, 2025
66ec9fa
Update dependencies (2025-08-15 05:07:47)
Aug 15, 2025
5df2fd9
Merge branch 'main' into auto-microsoft-python/multi-layer-discriminator
msyyc Aug 18, 2025
10519a6
Merge branch 'main' of https://github.com/Azure/autorest.python into …
Sep 2, 2025
808aefa
regen
Sep 2, 2025
3831eaf
merge
msyyc Sep 4, 2025
41c8a42
Update dependencies
Sep 4, 2025
b09c392
Update dependencies (2025-09-04 07:11:58)
Sep 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@azure-tools/typespec-python"
---

DPG model supports multi-layer discriminator.
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -47,4 +47,4 @@
"requirements.txt",
"generator/"
]
}
}
4 changes: 2 additions & 2 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -103,4 +103,4 @@
"chalk": "5.3.0",
"@types/fs-extra": "11.0.4"
}
}
}
9 changes: 4 additions & 5 deletions packages/typespec-python/scripts/eng/regenerate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ interface TspCommand {
}

// Add this near the top with other constants
const SKIP_SPECS = [
"type/union/discriminated",
"client-operation-group",
"azure/client-generator-core/hierarchy-building",
];
const SKIP_SPECS = ["type/union/discriminated", "client-operation-group"];

const AZURE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, string>[]> = {
"azure/client-generator-core/access": {
Expand All @@ -51,6 +47,9 @@ const AZURE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<stri
"azure/client-generator-core/override": {
namespace: "specs.azure.clientgenerator.core.override",
},
"azure/client-generator-core/hierarchy-building": {
namespace: "specs.azure.clientgenerator.core.hierarchybuilding",
},
"azure/core/basic": {
namespace: "specs.azure.core.basic",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,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" # type: ignore


class SharedModel(_Model):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 1.0.0b1 (1970-01-01)

- Initial version
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include *.md
include LICENSE
include specs/azure/clientgenerator/core/hierarchybuilding/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include specs/__init__.py
include specs/azure/__init__.py
include specs/azure/clientgenerator/__init__.py
include specs/azure/clientgenerator/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Specs Azure Clientgenerator Core Hierarchybuilding client library for Python
<!-- write necessary description of service -->

## 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 [email protected] with any
additional questions or comments.

<!-- LINKS -->
[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/
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-e ../../../tools/azure-sdk-tools
../../core/azure-core
aiohttp
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
@@ -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
# ...

Original file line number Diff line number Diff line change
@@ -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
# ...

Original file line number Diff line number Diff line change
@@ -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
# ...

Original file line number Diff line number Diff line change
@@ -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
# ...

Loading
Loading