|
25 | 25 | AgentCard, |
26 | 26 | CancelTaskRequest, |
27 | 27 | CreateTaskPushNotificationConfigRequest, |
| 28 | + DeleteTaskPushNotificationConfigRequest, |
28 | 29 | GetExtendedAgentCardRequest, |
29 | 30 | GetTaskPushNotificationConfigRequest, |
30 | 31 | GetTaskRequest, |
| 32 | + ListTaskPushNotificationConfigRequest, |
| 33 | + ListTaskPushNotificationConfigResponse, |
31 | 34 | ListTasksRequest, |
32 | 35 | ListTasksResponse, |
33 | 36 | SendMessageRequest, |
@@ -378,6 +381,69 @@ async def get_task_callback( |
378 | 381 | ) |
379 | 382 | return response |
380 | 383 |
|
| 384 | + async def list_task_callback( |
| 385 | + self, |
| 386 | + request: ListTaskPushNotificationConfigRequest, |
| 387 | + *, |
| 388 | + context: ClientCallContext | None = None, |
| 389 | + extensions: list[str] | None = None, |
| 390 | + ) -> ListTaskPushNotificationConfigResponse: |
| 391 | + """Lists push notification configurations for a specific task.""" |
| 392 | + rpc_request = JSONRPC20Request( |
| 393 | + method='ListTaskPushNotificationConfig', |
| 394 | + params=json_format.MessageToDict(request), |
| 395 | + _id=str(uuid4()), |
| 396 | + ) |
| 397 | + modified_kwargs = update_extension_header( |
| 398 | + self._get_http_args(context), |
| 399 | + extensions if extensions is not None else self.extensions, |
| 400 | + ) |
| 401 | + payload, modified_kwargs = await self._apply_interceptors( |
| 402 | + 'ListTaskPushNotificationConfig', |
| 403 | + cast('dict[str, Any]', rpc_request.data), |
| 404 | + modified_kwargs, |
| 405 | + context, |
| 406 | + ) |
| 407 | + response_data = await self._send_request(payload, modified_kwargs) |
| 408 | + json_rpc_response = JSONRPC20Response(**response_data) |
| 409 | + if json_rpc_response.error: |
| 410 | + raise A2AClientJSONRPCError(json_rpc_response.error) |
| 411 | + response: ListTaskPushNotificationConfigResponse = ( |
| 412 | + json_format.ParseDict( |
| 413 | + json_rpc_response.result, |
| 414 | + ListTaskPushNotificationConfigResponse(), |
| 415 | + ) |
| 416 | + ) |
| 417 | + return response |
| 418 | + |
| 419 | + async def delete_task_callback( |
| 420 | + self, |
| 421 | + request: DeleteTaskPushNotificationConfigRequest, |
| 422 | + *, |
| 423 | + context: ClientCallContext | None = None, |
| 424 | + extensions: list[str] | None = None, |
| 425 | + ) -> None: |
| 426 | + """Deletes the push notification configuration for a specific task.""" |
| 427 | + rpc_request = JSONRPC20Request( |
| 428 | + method='DeleteTaskPushNotificationConfig', |
| 429 | + params=json_format.MessageToDict(request), |
| 430 | + _id=str(uuid4()), |
| 431 | + ) |
| 432 | + modified_kwargs = update_extension_header( |
| 433 | + self._get_http_args(context), |
| 434 | + extensions if extensions is not None else self.extensions, |
| 435 | + ) |
| 436 | + payload, modified_kwargs = await self._apply_interceptors( |
| 437 | + 'DeleteTaskPushNotificationConfig', |
| 438 | + cast('dict[str, Any]', rpc_request.data), |
| 439 | + modified_kwargs, |
| 440 | + context, |
| 441 | + ) |
| 442 | + response_data = await self._send_request(payload, modified_kwargs) |
| 443 | + json_rpc_response = JSONRPC20Response(**response_data) |
| 444 | + if json_rpc_response.error: |
| 445 | + raise A2AClientJSONRPCError(json_rpc_response.error) |
| 446 | + |
381 | 447 | async def subscribe( |
382 | 448 | self, |
383 | 449 | request: SubscribeToTaskRequest, |
|
0 commit comments