acl->checkScope(Import::ENTITY_TYPE)) { throw new Forbidden(); } $data = $request->getParsedBody(); $entityType = $data->entityType ?? null; $attributeList = $data->attributeList ?? null; $attachmentId = $data->attachmentId ?? null; if (!is_array($attributeList)) { throw new BadRequest("No `attributeList`."); } if (!$attachmentId) { throw new BadRequest("No `attachmentId`."); } if (!$entityType) { throw new BadRequest("No `entityType`."); } $params = ImportParams::fromRaw($data); $result = $this->service->import($entityType, $attributeList, $attachmentId, $params); return ResponseComposer::json($result->getValueMap()); } }