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