Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Allow client options on child clients to override parent clients
2 changes: 1 addition & 1 deletion 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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg4OTg4NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTkxOTQwOS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
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.21.0",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg4OTg4NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTkxOTQwOS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand All @@ -87,7 +87,7 @@
"@azure-tools/typespec-autorest": "~0.65.0",
"@azure-tools/typespec-client-generator-core": "~0.65.1",
"@azure-tools/azure-http-specs": "0.1.0-alpha.38-dev.2",
"@typespec/http-specs": "0.1.0-alpha.33-dev.2",
"@typespec/http-specs": "0.1.0-alpha.32",
"@typespec/spector": "0.1.0-alpha.23",
"@typespec/spec-api": "0.1.0-alpha.12",
"@types/js-yaml": "~4.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal",
"specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic",
"specs.azure.clientgenerator.core.access.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel",
"specs.azure.clientgenerator.core.access.operations.PublicOperationOperations.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic",
"specs.azure.clientgenerator.core.access.aio.operations.PublicOperationOperations.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic",
"specs.azure.clientgenerator.core.access.operations.PublicOperationOperations.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic",
"specs.azure.clientgenerator.core.access.aio.operations.PublicOperationOperations.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic",
"specs.azure.clientgenerator.core.access.operations.SharedModelInOperationOperations.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public",
"specs.azure.clientgenerator.core.access.aio.operations.SharedModelInOperationOperations.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public"
"specs.azure.clientgenerator.core.access.operations.AccessClientPublicOperationOperations.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic",
"specs.azure.clientgenerator.core.access.aio.operations.AccessClientPublicOperationOperations.no_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.noDecoratorInPublic",
"specs.azure.clientgenerator.core.access.operations.AccessClientPublicOperationOperations.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic",
"specs.azure.clientgenerator.core.access.aio.operations.AccessClientPublicOperationOperations.public_decorator_in_public": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.publicDecoratorInPublic",
"specs.azure.clientgenerator.core.access.operations.AccessClientSharedModelInOperationOperations.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public",
"specs.azure.clientgenerator.core.access.aio.operations.AccessClientSharedModelInOperationOperations.public": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.public"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for 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 AccessClientTestBase, AccessPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestAccessAccessClientPublicOperationOperations(AccessClientTestBase):
@AccessPreparer()
@recorded_by_proxy
def test_access_client_public_operation_no_decorator_in_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.access_client_public_operation.no_decorator_in_public(
name="str",
)

# please add some check logic here by yourself
# ...

@AccessPreparer()
@recorded_by_proxy
def test_access_client_public_operation_public_decorator_in_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.access_client_public_operation.public_decorator_in_public(
name="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for 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 AccessPreparer
from testpreparer_async import AccessClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestAccessAccessClientPublicOperationOperationsAsync(AccessClientTestBaseAsync):
@AccessPreparer()
@recorded_by_proxy_async
async def test_access_client_public_operation_no_decorator_in_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.access_client_public_operation.no_decorator_in_public(
name="str",
)

# please add some check logic here by yourself
# ...

@AccessPreparer()
@recorded_by_proxy_async
async def test_access_client_public_operation_public_decorator_in_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.access_client_public_operation.public_decorator_in_public(
name="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for 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 AccessClientTestBase, AccessPreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestAccessAccessClientSharedModelInOperationOperations(AccessClientTestBase):
@AccessPreparer()
@recorded_by_proxy
def test_access_client_shared_model_in_operation_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.access_client_shared_model_in_operation.public(
name="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import AccessPreparer
from testpreparer_async import AccessClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestAccessAccessClientSharedModelInOperationOperationsAsync(AccessClientTestBaseAsync):
@AccessPreparer()
@recorded_by_proxy_async
async def test_access_client_shared_model_in_operation_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.access_client_shared_model_in_operation.public(
name="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,30 @@
from ._configuration import AccessClientConfiguration
from ._utils.serialization import Deserializer, Serializer
from .operations import (
InternalOperationOperations,
PublicOperationOperations,
RelativeModelInOperationOperations,
SharedModelInOperationOperations,
AccessClientInternalOperationOperations,
AccessClientPublicOperationOperations,
AccessClientRelativeModelInOperationOperations,
AccessClientSharedModelInOperationOperations,
)


class AccessClient: # pylint: disable=client-accepts-api-version-keyword
"""Test for internal decorator.

:ivar public_operation: PublicOperationOperations operations
:vartype public_operation:
specs.azure.clientgenerator.core.access.operations.PublicOperationOperations
:ivar internal_operation: InternalOperationOperations operations
:vartype internal_operation:
specs.azure.clientgenerator.core.access.operations.InternalOperationOperations
:ivar shared_model_in_operation: SharedModelInOperationOperations operations
:vartype shared_model_in_operation:
specs.azure.clientgenerator.core.access.operations.SharedModelInOperationOperations
:ivar relative_model_in_operation: RelativeModelInOperationOperations operations
:vartype relative_model_in_operation:
specs.azure.clientgenerator.core.access.operations.RelativeModelInOperationOperations
:ivar access_client_public_operation: AccessClientPublicOperationOperations operations
:vartype access_client_public_operation:
specs.azure.clientgenerator.core.access.operations.AccessClientPublicOperationOperations
:ivar access_client_internal_operation: AccessClientInternalOperationOperations operations
:vartype access_client_internal_operation:
specs.azure.clientgenerator.core.access.operations.AccessClientInternalOperationOperations
:ivar access_client_shared_model_in_operation: AccessClientSharedModelInOperationOperations
operations
:vartype access_client_shared_model_in_operation:
specs.azure.clientgenerator.core.access.operations.AccessClientSharedModelInOperationOperations
:ivar access_client_relative_model_in_operation: AccessClientRelativeModelInOperationOperations
operations
:vartype access_client_relative_model_in_operation:
specs.azure.clientgenerator.core.access.operations.AccessClientRelativeModelInOperationOperations
:keyword endpoint: Service host. Default value is "http://localhost:3000".
:paramtype endpoint: str
"""
Expand Down Expand Up @@ -71,16 +73,16 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.public_operation = PublicOperationOperations(
self.access_client_public_operation = AccessClientPublicOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.internal_operation = InternalOperationOperations(
self.access_client_internal_operation = AccessClientInternalOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.shared_model_in_operation = SharedModelInOperationOperations(
self.access_client_shared_model_in_operation = AccessClientSharedModelInOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.relative_model_in_operation = RelativeModelInOperationOperations(
self.access_client_relative_model_in_operation = AccessClientRelativeModelInOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,30 @@
from .._utils.serialization import Deserializer, Serializer
from ._configuration import AccessClientConfiguration
from .operations import (
InternalOperationOperations,
PublicOperationOperations,
RelativeModelInOperationOperations,
SharedModelInOperationOperations,
AccessClientInternalOperationOperations,
AccessClientPublicOperationOperations,
AccessClientRelativeModelInOperationOperations,
AccessClientSharedModelInOperationOperations,
)


class AccessClient: # pylint: disable=client-accepts-api-version-keyword
"""Test for internal decorator.

:ivar public_operation: PublicOperationOperations operations
:vartype public_operation:
specs.azure.clientgenerator.core.access.aio.operations.PublicOperationOperations
:ivar internal_operation: InternalOperationOperations operations
:vartype internal_operation:
specs.azure.clientgenerator.core.access.aio.operations.InternalOperationOperations
:ivar shared_model_in_operation: SharedModelInOperationOperations operations
:vartype shared_model_in_operation:
specs.azure.clientgenerator.core.access.aio.operations.SharedModelInOperationOperations
:ivar relative_model_in_operation: RelativeModelInOperationOperations operations
:vartype relative_model_in_operation:
specs.azure.clientgenerator.core.access.aio.operations.RelativeModelInOperationOperations
:ivar access_client_public_operation: AccessClientPublicOperationOperations operations
:vartype access_client_public_operation:
specs.azure.clientgenerator.core.access.aio.operations.AccessClientPublicOperationOperations
:ivar access_client_internal_operation: AccessClientInternalOperationOperations operations
:vartype access_client_internal_operation:
specs.azure.clientgenerator.core.access.aio.operations.AccessClientInternalOperationOperations
:ivar access_client_shared_model_in_operation: AccessClientSharedModelInOperationOperations
operations
:vartype access_client_shared_model_in_operation:
specs.azure.clientgenerator.core.access.aio.operations.AccessClientSharedModelInOperationOperations
:ivar access_client_relative_model_in_operation: AccessClientRelativeModelInOperationOperations
operations
:vartype access_client_relative_model_in_operation:
specs.azure.clientgenerator.core.access.aio.operations.AccessClientRelativeModelInOperationOperations
:keyword endpoint: Service host. Default value is "http://localhost:3000".
:paramtype endpoint: str
"""
Expand Down Expand Up @@ -71,16 +73,16 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.public_operation = PublicOperationOperations(
self.access_client_public_operation = AccessClientPublicOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.internal_operation = InternalOperationOperations(
self.access_client_internal_operation = AccessClientInternalOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.shared_model_in_operation = SharedModelInOperationOperations(
self.access_client_shared_model_in_operation = AccessClientSharedModelInOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.relative_model_in_operation = RelativeModelInOperationOperations(
self.access_client_relative_model_in_operation = AccessClientRelativeModelInOperationOperations(
self._client, self._config, self._serialize, self._deserialize
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._operations import PublicOperationOperations # type: ignore
from ._operations import InternalOperationOperations # type: ignore
from ._operations import SharedModelInOperationOperations # type: ignore
from ._operations import RelativeModelInOperationOperations # type: ignore
from ._operations import AccessClientPublicOperationOperations # type: ignore
from ._operations import AccessClientInternalOperationOperations # type: ignore
from ._operations import AccessClientSharedModelInOperationOperations # type: ignore
from ._operations import AccessClientRelativeModelInOperationOperations # type: ignore

from ._patch import __all__ as _patch_all
from ._patch import *
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"PublicOperationOperations",
"InternalOperationOperations",
"SharedModelInOperationOperations",
"RelativeModelInOperationOperations",
"AccessClientPublicOperationOperations",
"AccessClientInternalOperationOperations",
"AccessClientSharedModelInOperationOperations",
"AccessClientRelativeModelInOperationOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
Loading
Loading