service = $service; } /** * @throws BadRequest * @throws Forbidden * @throws Error * @throws NotFound */ public function postActionRun(Request $request): stdClass { $data = $request->getParsedBody(); $id = $data->id ?? null; $targetId = $data->targetId ?? null; if (!$id || !$targetId) { throw new BadRequest(); } $result = $this->service->runManual($id, $targetId); $response = (object) []; if ($result->alert) { $response->message = $result->alert->message; $response->type = $result->alert->type; $response->autoClose = $result->alert->autoClose; } return $response; } }