deleteTaskPushNotificationConfig method

  1. @override
Future<void> deleteTaskPushNotificationConfig(
  1. A2ADeleteTaskPushNotificationConfigParams params
)
override

Implementation

@override
Future<void> deleteTaskPushNotificationConfig(
  A2ADeleteTaskPushNotificationConfigParams params,
) async {
  if (_agentCard.capabilities.pushNotifications == false) {
    throw A2AServerError.pushNotificationNotSupported();
  }

  final task = await _taskStore.load(params.id);
  if (task == null) {
    throw A2AServerError.taskNotFound(params.id);
  }

  final configs = _pushNotificationConfigs[params.id];

  configs!.removeWhere((e) => e.id == params.id);

  return;
}