Skip to content

Commit d16a1f8

Browse files
committed
Fixes after merge
1 parent 9163a19 commit d16a1f8

14 files changed

Lines changed: 82 additions & 82 deletions

File tree

src/a2a/client/base_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
DeleteTaskPushNotificationConfigRequest,
2222
GetTaskPushNotificationConfigRequest,
2323
GetTaskRequest,
24-
ListTaskPushNotificationConfigRequest,
25-
ListTaskPushNotificationConfigResponse,
24+
ListTaskPushNotificationConfigsRequest,
25+
ListTaskPushNotificationConfigsResponse,
2626
ListTasksRequest,
2727
ListTasksResponse,
2828
Message,
@@ -252,20 +252,20 @@ async def get_task_callback(
252252

253253
async def list_task_callback(
254254
self,
255-
request: ListTaskPushNotificationConfigRequest,
255+
request: ListTaskPushNotificationConfigsRequest,
256256
*,
257257
context: ClientCallContext | None = None,
258258
extensions: list[str] | None = None,
259-
) -> ListTaskPushNotificationConfigResponse:
259+
) -> ListTaskPushNotificationConfigsResponse:
260260
"""Lists push notification configurations for a specific task.
261261
262262
Args:
263-
request: The `ListTaskPushNotificationConfigRequest` object specifying the request.
263+
request: The `ListTaskPushNotificationConfigsRequest` object specifying the request.
264264
context: The client call context.
265265
extensions: List of extensions to be activated.
266266
267267
Returns:
268-
A `ListTaskPushNotificationConfigResponse` object.
268+
A `ListTaskPushNotificationConfigsResponse` object.
269269
"""
270270
return await self._transport.list_task_callback(
271271
request, context=context, extensions=extensions

src/a2a/client/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
DeleteTaskPushNotificationConfigRequest,
1717
GetTaskPushNotificationConfigRequest,
1818
GetTaskRequest,
19-
ListTaskPushNotificationConfigRequest,
20-
ListTaskPushNotificationConfigResponse,
19+
ListTaskPushNotificationConfigsRequest,
20+
ListTaskPushNotificationConfigsResponse,
2121
ListTasksRequest,
2222
ListTasksResponse,
2323
Message,
@@ -181,11 +181,11 @@ async def get_task_callback(
181181
@abstractmethod
182182
async def list_task_callback(
183183
self,
184-
request: ListTaskPushNotificationConfigRequest,
184+
request: ListTaskPushNotificationConfigsRequest,
185185
*,
186186
context: ClientCallContext | None = None,
187187
extensions: list[str] | None = None,
188-
) -> ListTaskPushNotificationConfigResponse:
188+
) -> ListTaskPushNotificationConfigsResponse:
189189
"""Lists push notification configurations for a specific task."""
190190

191191
@abstractmethod

src/a2a/client/transports/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
DeleteTaskPushNotificationConfigRequest,
1313
GetTaskPushNotificationConfigRequest,
1414
GetTaskRequest,
15-
ListTaskPushNotificationConfigRequest,
16-
ListTaskPushNotificationConfigResponse,
15+
ListTaskPushNotificationConfigsRequest,
16+
ListTaskPushNotificationConfigsResponse,
1717
ListTasksRequest,
1818
ListTasksResponse,
1919
SendMessageRequest,
@@ -116,11 +116,11 @@ async def get_task_callback(
116116
@abstractmethod
117117
async def list_task_callback(
118118
self,
119-
request: ListTaskPushNotificationConfigRequest,
119+
request: ListTaskPushNotificationConfigsRequest,
120120
*,
121121
context: ClientCallContext | None = None,
122122
extensions: list[str] | None = None,
123-
) -> ListTaskPushNotificationConfigResponse:
123+
) -> ListTaskPushNotificationConfigsResponse:
124124
"""Lists push notification configurations for a specific task."""
125125

126126
@abstractmethod

src/a2a/client/transports/grpc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
DeleteTaskPushNotificationConfigRequest,
2727
GetTaskPushNotificationConfigRequest,
2828
GetTaskRequest,
29-
ListTaskPushNotificationConfigRequest,
30-
ListTaskPushNotificationConfigResponse,
29+
ListTaskPushNotificationConfigsRequest,
30+
ListTaskPushNotificationConfigsResponse,
3131
ListTasksRequest,
3232
ListTasksResponse,
3333
SendMessageRequest,
@@ -203,13 +203,13 @@ async def get_task_callback(
203203

204204
async def list_task_callback(
205205
self,
206-
request: ListTaskPushNotificationConfigRequest,
206+
request: ListTaskPushNotificationConfigsRequest,
207207
*,
208208
context: ClientCallContext | None = None,
209209
extensions: list[str] | None = None,
210-
) -> ListTaskPushNotificationConfigResponse:
210+
) -> ListTaskPushNotificationConfigsResponse:
211211
"""Lists push notification configurations for a specific task."""
212-
return await self.stub.ListTaskPushNotificationConfig(
212+
return await self.stub.ListTaskPushNotificationConfigs(
213213
request,
214214
metadata=self._get_grpc_metadata(extensions),
215215
)

src/a2a/client/transports/jsonrpc.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
GetExtendedAgentCardRequest,
2929
GetTaskPushNotificationConfigRequest,
3030
GetTaskRequest,
31-
ListTaskPushNotificationConfigRequest,
32-
ListTaskPushNotificationConfigResponse,
31+
ListTaskPushNotificationConfigsRequest,
32+
ListTaskPushNotificationConfigsResponse,
3333
ListTasksRequest,
3434
ListTasksResponse,
3535
SendMessageRequest,
@@ -369,14 +369,14 @@ async def get_task_callback(
369369

370370
async def list_task_callback(
371371
self,
372-
request: ListTaskPushNotificationConfigRequest,
372+
request: ListTaskPushNotificationConfigsRequest,
373373
*,
374374
context: ClientCallContext | None = None,
375375
extensions: list[str] | None = None,
376-
) -> ListTaskPushNotificationConfigResponse:
376+
) -> ListTaskPushNotificationConfigsResponse:
377377
"""Lists push notification configurations for a specific task."""
378378
rpc_request = JSONRPC20Request(
379-
method='ListTaskPushNotificationConfig',
379+
method='ListTaskPushNotificationConfigs',
380380
params=json_format.MessageToDict(request),
381381
_id=str(uuid4()),
382382
)
@@ -385,7 +385,7 @@ async def list_task_callback(
385385
extensions if extensions is not None else self.extensions,
386386
)
387387
payload, modified_kwargs = await self._apply_interceptors(
388-
'ListTaskPushNotificationConfig',
388+
'ListTaskPushNotificationConfigs',
389389
cast('dict[str, Any]', rpc_request.data),
390390
modified_kwargs,
391391
context,
@@ -394,10 +394,10 @@ async def list_task_callback(
394394
json_rpc_response = JSONRPC20Response(**response_data)
395395
if json_rpc_response.error:
396396
raise A2AClientJSONRPCError(json_rpc_response.error)
397-
response: ListTaskPushNotificationConfigResponse = (
397+
response: ListTaskPushNotificationConfigsResponse = (
398398
json_format.ParseDict(
399399
json_rpc_response.result,
400-
ListTaskPushNotificationConfigResponse(),
400+
ListTaskPushNotificationConfigsResponse(),
401401
)
402402
)
403403
return response

src/a2a/client/transports/rest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
DeleteTaskPushNotificationConfigRequest,
2626
GetTaskPushNotificationConfigRequest,
2727
GetTaskRequest,
28-
ListTaskPushNotificationConfigRequest,
29-
ListTaskPushNotificationConfigResponse,
28+
ListTaskPushNotificationConfigsRequest,
29+
ListTaskPushNotificationConfigsResponse,
3030
ListTasksRequest,
3131
ListTasksResponse,
3232
SendMessageRequest,
@@ -358,11 +358,11 @@ async def get_task_callback(
358358

359359
async def list_task_callback(
360360
self,
361-
request: ListTaskPushNotificationConfigRequest,
361+
request: ListTaskPushNotificationConfigsRequest,
362362
*,
363363
context: ClientCallContext | None = None,
364364
extensions: list[str] | None = None,
365-
) -> ListTaskPushNotificationConfigResponse:
365+
) -> ListTaskPushNotificationConfigsResponse:
366366
"""Lists push notification configurations for a specific task."""
367367
params = MessageToDict(request)
368368
modified_kwargs = update_extension_header(
@@ -381,8 +381,8 @@ async def list_task_callback(
381381
params,
382382
modified_kwargs,
383383
)
384-
response: ListTaskPushNotificationConfigResponse = ParseDict(
385-
response_data, ListTaskPushNotificationConfigResponse()
384+
response: ListTaskPushNotificationConfigsResponse = ParseDict(
385+
response_data, ListTaskPushNotificationConfigsResponse()
386386
)
387387
return response
388388

src/a2a/server/request_handlers/grpc_handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,29 +294,29 @@ async def CreateTaskPushNotificationConfig(
294294
await self.abort_context(e, context)
295295
return a2a_pb2.TaskPushNotificationConfig()
296296

297-
async def ListTaskPushNotificationConfig(
297+
async def ListTaskPushNotificationConfigs(
298298
self,
299-
request: a2a_pb2.ListTaskPushNotificationConfigRequest,
299+
request: a2a_pb2.ListTaskPushNotificationConfigsRequest,
300300
context: grpc.aio.ServicerContext,
301-
) -> a2a_pb2.ListTaskPushNotificationConfigResponse:
301+
) -> a2a_pb2.ListTaskPushNotificationConfigsResponse:
302302
"""Handles the 'ListTaskPushNotificationConfig' gRPC method.
303303
304304
Args:
305-
request: The incoming `ListTaskPushNotificationConfigRequest` object.
305+
request: The incoming `ListTaskPushNotificationConfigsRequest` object.
306306
context: Context provided by the server.
307307
308308
Returns:
309-
A `ListTaskPushNotificationConfigResponse` object containing the configs.
309+
A `ListTaskPushNotificationConfigsResponse` object containing the configs.
310310
"""
311311
try:
312312
server_context = self.context_builder.build(context)
313-
return await self.request_handler.on_list_task_push_notification_config(
313+
return await self.request_handler.on_list_task_push_notification_configs(
314314
request,
315315
server_context,
316316
)
317317
except ServerError as e:
318318
await self.abort_context(e, context)
319-
return a2a_pb2.ListTaskPushNotificationConfigResponse()
319+
return a2a_pb2.ListTaskPushNotificationConfigsResponse()
320320

321321
async def DeleteTaskPushNotificationConfig(
322322
self,

src/a2a/server/request_handlers/rest_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ async def list_push_notifications(
319319
A list of `dict` representing the `TaskPushNotificationConfig` objects.
320320
"""
321321
task_id = request.path_params['id']
322-
params = a2a_pb2.ListTaskPushNotificationConfigRequest(task_id=task_id)
322+
params = a2a_pb2.ListTaskPushNotificationConfigsRequest(task_id=task_id)
323323

324324
# Parse query params, keeping arrays/repeated fields in mind if there are any
325325
ParseDict(
326326
dict(request.query_params), params, ignore_unknown_fields=True
327327
)
328328

329329
result = (
330-
await self.request_handler.on_list_task_push_notification_config(
330+
await self.request_handler.on_list_task_push_notification_configs(
331331
params, context
332332
)
333333
)

tests/client/transports/test_grpc_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
CreateTaskPushNotificationConfigRequest,
1616
DeleteTaskPushNotificationConfigRequest,
1717
GetTaskPushNotificationConfigRequest,
18-
ListTaskPushNotificationConfigRequest,
19-
ListTaskPushNotificationConfigResponse,
18+
ListTaskPushNotificationConfigsRequest,
19+
ListTaskPushNotificationConfigsResponse,
2020
GetTaskRequest,
2121
Message,
2222
Part,
@@ -45,7 +45,7 @@ def mock_grpc_stub() -> AsyncMock:
4545
stub.CancelTask = AsyncMock()
4646
stub.CreateTaskPushNotificationConfig = AsyncMock()
4747
stub.GetTaskPushNotificationConfig = AsyncMock()
48-
stub.ListTaskPushNotificationConfig = AsyncMock()
48+
stub.ListTaskPushNotificationConfigs = AsyncMock()
4949
stub.DeleteTaskPushNotificationConfig = AsyncMock()
5050
return stub
5151

@@ -538,18 +538,18 @@ async def test_list_task_callback(
538538
sample_task_push_notification_config: TaskPushNotificationConfig,
539539
) -> None:
540540
"""Test retrieving task push notification configs."""
541-
mock_grpc_stub.ListTaskPushNotificationConfig.return_value = (
542-
a2a_pb2.ListTaskPushNotificationConfigResponse(
541+
mock_grpc_stub.ListTaskPushNotificationConfigs.return_value = (
542+
a2a_pb2.ListTaskPushNotificationConfigsResponse(
543543
configs=[sample_task_push_notification_config]
544544
)
545545
)
546546

547547
response = await grpc_transport.list_task_callback(
548-
ListTaskPushNotificationConfigRequest(task_id='task-1')
548+
ListTaskPushNotificationConfigsRequest(task_id='task-1')
549549
)
550550

551-
mock_grpc_stub.ListTaskPushNotificationConfig.assert_awaited_once_with(
552-
a2a_pb2.ListTaskPushNotificationConfigRequest(task_id='task-1'),
551+
mock_grpc_stub.ListTaskPushNotificationConfigs.assert_awaited_once_with(
552+
a2a_pb2.ListTaskPushNotificationConfigsRequest(task_id='task-1'),
553553
metadata=[
554554
(
555555
HTTP_EXTENSION_HEADER.lower(),

tests/client/transports/test_jsonrpc_client.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
CreateTaskPushNotificationConfigRequest,
2727
DeleteTaskPushNotificationConfigRequest,
2828
GetTaskPushNotificationConfigRequest,
29-
ListTaskPushNotificationConfigRequest,
30-
ListTaskPushNotificationConfigResponse,
29+
ListTaskPushNotificationConfigsRequest,
30+
ListTaskPushNotificationConfigsResponse,
3131
GetTaskRequest,
3232
Message,
3333
Part,
@@ -371,7 +371,6 @@ async def test_list_task_callback_success(
371371
'configs': [
372372
{
373373
'task_id': f'{task_id}',
374-
'id': 'config-1',
375374
'push_notification_config': {
376375
'id': 'config-1',
377376
'url': 'https://example.com',
@@ -383,7 +382,7 @@ async def test_list_task_callback_success(
383382
mock_response.raise_for_status = MagicMock()
384383
mock_httpx_client.post.return_value = mock_response
385384

386-
request = ListTaskPushNotificationConfigRequest(
385+
request = ListTaskPushNotificationConfigsRequest(
387386
task_id=f'{task_id}',
388387
)
389388
response = await transport.list_task_callback(request)
@@ -392,7 +391,7 @@ async def test_list_task_callback_success(
392391
assert response.configs[0].task_id == task_id
393392
call_args = mock_httpx_client.post.call_args
394393
payload = call_args[1]['json']
395-
assert payload['method'] == 'ListTaskPushNotificationConfig'
394+
assert payload['method'] == 'ListTaskPushNotificationConfigs'
396395

397396
@pytest.mark.asyncio
398397
async def test_delete_task_callback_success(
@@ -406,7 +405,6 @@ async def test_delete_task_callback_success(
406405
'id': '1',
407406
'result': {
408407
'task_id': f'{task_id}',
409-
'id': 'config-1',
410408
},
411409
}
412410
mock_response.raise_for_status = MagicMock()

0 commit comments

Comments
 (0)