automationStorage = $automationStorage; $this->subscriberController = $subscriberController; } public static function getRequestSchema(): array { return [ 'id' => Builder::integer()->required(), 'query' => Query::getRequestSchema(), ]; } public function handle(Request $request): Response { $id = absint($request->getParam('id')); $automation = $this->automationStorage->getAutomation($id); if (!$automation) { throw Exceptions::automationNotFound($id); } $query = Query::fromRequest($request); $result = $this->subscriberController->getSubscribersForAutomation($automation, $query); return new Response($result); } }