mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-13 15:14:50 -06:00
feat: Add sortByColumn functionality to List Operation
This change introduces the ability to sort results by a specific column in the List Operation. PiperOrigin-RevId: 766468964
This commit is contained in:
parent
eb2b9ef88f
commit
af95dd2932
@ -252,6 +252,12 @@ class ConnectionsClient:
|
|||||||
"Timeout in seconds for execution of custom query"
|
"Timeout in seconds for execution of custom query"
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
"sortByColumns": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {"type": "string"},
|
||||||
|
"default": [],
|
||||||
|
"description": "Column to sort the results by",
|
||||||
|
},
|
||||||
"connectorOutputPayload": {"type": "object"},
|
"connectorOutputPayload": {"type": "object"},
|
||||||
"nextPageToken": {"type": "string"},
|
"nextPageToken": {"type": "string"},
|
||||||
"execute-connector_Response": {
|
"execute-connector_Response": {
|
||||||
@ -665,6 +671,7 @@ class ConnectionsClient:
|
|||||||
"serviceName": {"$ref": "#/components/schemas/serviceName"},
|
"serviceName": {"$ref": "#/components/schemas/serviceName"},
|
||||||
"host": {"$ref": "#/components/schemas/host"},
|
"host": {"$ref": "#/components/schemas/host"},
|
||||||
"entity": {"$ref": "#/components/schemas/entity"},
|
"entity": {"$ref": "#/components/schemas/entity"},
|
||||||
|
"sortByColumns": {"$ref": "#/components/schemas/sortByColumns"},
|
||||||
"dynamicAuthConfig": {
|
"dynamicAuthConfig": {
|
||||||
"$ref": "#/components/schemas/dynamicAuthConfig"
|
"$ref": "#/components/schemas/dynamicAuthConfig"
|
||||||
},
|
},
|
||||||
|
@ -64,11 +64,7 @@ class IntegrationConnectorTool(BaseTool):
|
|||||||
'dynamic_auth_config',
|
'dynamic_auth_config',
|
||||||
]
|
]
|
||||||
|
|
||||||
OPTIONAL_FIELDS = [
|
OPTIONAL_FIELDS = ['page_size', 'page_token', 'filter', 'sortByColumns']
|
||||||
'page_size',
|
|
||||||
'page_token',
|
|
||||||
'filter',
|
|
||||||
]
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -511,6 +511,7 @@ class TestConnectionsClient:
|
|||||||
assert schema["type"] == "object"
|
assert schema["type"] == "object"
|
||||||
assert "properties" in schema
|
assert "properties" in schema
|
||||||
assert "filterClause" in schema["properties"]
|
assert "filterClause" in schema["properties"]
|
||||||
|
assert "sortByColumns" in schema["properties"]
|
||||||
|
|
||||||
def test_action_request(self):
|
def test_action_request(self):
|
||||||
schema = ConnectionsClient.action_request("TestAction")
|
schema = ConnectionsClient.action_request("TestAction")
|
||||||
|
@ -157,7 +157,11 @@ async def test_run_with_auth_async_none_token(
|
|||||||
integration_tool_with_auth, mock_rest_api_tool
|
integration_tool_with_auth, mock_rest_api_tool
|
||||||
):
|
):
|
||||||
"""Tests run_async when auth credential token is None."""
|
"""Tests run_async when auth credential token is None."""
|
||||||
input_args = {"user_id": "user456", "filter": "some_filter"}
|
input_args = {
|
||||||
|
"user_id": "user456",
|
||||||
|
"filter": "some_filter",
|
||||||
|
"sortByColumns": ["a", "b"],
|
||||||
|
}
|
||||||
expected_call_args = {
|
expected_call_args = {
|
||||||
"user_id": "user456",
|
"user_id": "user456",
|
||||||
"filter": "some_filter",
|
"filter": "some_filter",
|
||||||
@ -168,6 +172,7 @@ async def test_run_with_auth_async_none_token(
|
|||||||
"entity": "TestEntity",
|
"entity": "TestEntity",
|
||||||
"operation": "LIST",
|
"operation": "LIST",
|
||||||
"action": "TestAction",
|
"action": "TestAction",
|
||||||
|
"sortByColumns": ["a", "b"],
|
||||||
}
|
}
|
||||||
|
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
|
Loading…
Reference in New Issue
Block a user