def METHOD_NAME(pk: int, agent_id: Optional[str] = None) -> str:
    with suppress(
        AutomatedTask.DoesNotExist,
        Agent.DoesNotExist,
    ):
        task = AutomatedTask.objects.get(pk=pk)
        if agent_id:
            task.METHOD_NAME(Agent.objects.get(agent_id=agent_id))
        else:
            task.METHOD_NAME()
    return "ok"