diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2PresentationApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2PresentationApiController.php index 682555eb8..99647c11c 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2PresentationApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2PresentationApiController.php @@ -1,4 +1,7 @@ - [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent( + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationVideo") + ) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationVideos($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -142,12 +169,34 @@ public function getPresentationVideos($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $video_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/video/{video_id}", + summary: "Get a video from a presentation", + operationId: "getPresentationVideo", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'video_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVideo") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationVideo($summit_id, $presentation_id, $video_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $video_id) { @@ -172,12 +221,34 @@ public function getPresentationVideo($summit_id, $presentation_id, $video_id) }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/videos", + summary: "Add a video to a presentation", + operationId: "addPresentationVideo", + security: [['summit_presentations_auth' => [SummitScopes::WriteVideoData, SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationVideosData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVideoRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVideo") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addVideo(LaravelRequest $request, $summit_id, $presentation_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id) { @@ -201,13 +272,35 @@ public function addVideo(LaravelRequest $request, $summit_id, $presentation_id) }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @param $video_id - * @return JsonResponse|mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/videos/{video_id}", + summary: "Update a video from a presentation", + operationId: "updatePresentationVideo", + security: [['summit_presentations_auth' => [SummitScopes::WriteVideoData, SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationVideosData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'video_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVideoRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVideo") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updateVideo(LaravelRequest $request, $summit_id, $presentation_id, $video_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id, $video_id) { @@ -231,12 +324,26 @@ public function updateVideo(LaravelRequest $request, $summit_id, $presentation_i }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $video_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/videos/{video_id}", + summary: "Delete a video from a presentation", + operationId: "deletePresentationVideo", + security: [['summit_presentations_auth' => [SummitScopes::WriteVideoData, SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationVideosData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'video_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deleteVideo($summit_id, $presentation_id, $video_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $video_id) { @@ -251,10 +358,32 @@ public function deleteVideo($summit_id, $presentation_id, $video_id) }); } - /** - * @param $summit_id - * @return mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations", + summary: "Submit a presentation", + operationId: "submitPresentation", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSubmissionRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/Presentation") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function submitPresentation($summit_id) { @@ -284,11 +413,28 @@ public function submitPresentation($summit_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}", + summary: "Get a presentation submission", + operationId: "getPresentationSubmission", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSubmission") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationSubmission($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -318,11 +464,33 @@ public function getPresentationSubmission($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}", + summary: "Update a presentation submission", + operationId: "updatePresentationSubmission", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSubmissionRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/Presentation") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updatePresentationSubmission($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -357,11 +525,28 @@ public function updatePresentationSubmission($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/completed", + summary: "Mark a presentation submission as completed", + operationId: "completePresentationSubmission", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/Presentation") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function completePresentationSubmission($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -386,11 +571,24 @@ public function completePresentationSubmission($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}", + summary: "Delete a presentation", + operationId: "deletePresentation", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deletePresentation($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -415,11 +613,29 @@ public function deletePresentation($summit_id, $presentation_id) // Slides - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/slides", + summary: "Get all slides from a presentation", + operationId: "getPresentationSlides", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent( + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationSlide") + ) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationSlides($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -450,12 +666,27 @@ public function getPresentationSlides($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $slide_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/slides/{slide_id}", + summary: "Get a slide from a presentation", + operationId: "getPresentationSlide", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'slide_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSlide") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationSlide($summit_id, $presentation_id, $slide_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $slide_id) { @@ -479,12 +710,37 @@ public function getPresentationSlide($summit_id, $presentation_id, $slide_id) }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/slides", + summary: "Add a slide to a presentation", + operationId: "addPresentationSlide", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationSlideRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSlide") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addPresentationSlide(LaravelRequest $request, $summit_id, $presentation_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id) { @@ -541,13 +797,38 @@ public function addPresentationSlide(LaravelRequest $request, $summit_id, $prese }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @param $slide_id - * @return JsonResponse|mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/slides/{slide_id}", + summary: "Update a slide from a presentation", + operationId: "updatePresentationSlide", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'slide_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationSlideRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSlide") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updatePresentationSlide(LaravelRequest $request, $summit_id, $presentation_id, $slide_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id, $slide_id) { @@ -604,12 +885,26 @@ public function updatePresentationSlide(LaravelRequest $request, $summit_id, $pr }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $slide_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/slides/{slide_id}", + summary: "Delete a slide from a presentation", + operationId: "deletePresentationSlide", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'slide_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deletePresentationSlide($summit_id, $presentation_id, $slide_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $slide_id) { @@ -638,11 +933,29 @@ public function deletePresentationSlide($summit_id, $presentation_id, $slide_id) // Links - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/links", + summary: "Get all links from a presentation", + operationId: "getPresentationLinks", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent( + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationLink") + ) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationLinks($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -673,12 +986,27 @@ public function getPresentationLinks($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $link_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/links/{link_id}", + summary: "Get a link from a presentation", + operationId: "getPresentationLink", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'link_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationLink") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationLink($summit_id, $presentation_id, $link_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $link_id) { @@ -704,12 +1032,37 @@ public function getPresentationLink($summit_id, $presentation_id, $link_id) } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/links", + summary: "Add a link to a presentation", + operationId: "addPresentationLink", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationLinksData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationLinkRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationLink") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addPresentationLink(LaravelRequest $request, $summit_id, $presentation_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id) { @@ -758,13 +1111,38 @@ public function addPresentationLink(LaravelRequest $request, $summit_id, $presen }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @param $link_id - * @return JsonResponse|mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/links/{link_id}", + summary: "Update a link from a presentation", + operationId: "updatePresentationLink", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationLinksData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'link_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationLinkRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationLink") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updatePresentationLink(LaravelRequest $request, $summit_id, $presentation_id, $link_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id, $link_id) { @@ -814,12 +1192,26 @@ public function updatePresentationLink(LaravelRequest $request, $summit_id, $pre }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $link_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/links/{link_id}", + summary: "Delete a link from a presentation", + operationId: "deletePresentationLink", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationLinksData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'link_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deletePresentationLink($summit_id, $presentation_id, $link_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $link_id) { @@ -847,11 +1239,52 @@ public function deletePresentationLink($summit_id, $presentation_id, $link_id) // MediaUploads - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/media-uploads", + summary: "Get all media uploads from a presentation", + operationId: "getPresentationMediaUploads", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent( + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationMediaUpload") + ) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] + #[OA\Get( + path: "/api/v1/summits/{id}/events/{event_id}/published/media-uploads", + summary: "Get all published media uploads from a presentation", + operationId: "getPresentationPublishedMediaUploads", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent( + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationMediaUpload") + ) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationMediaUploads($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -882,12 +1315,27 @@ public function getPresentationMediaUploads($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $media_upload_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/media-uploads/{media_upload_id}", + summary: "Get a media upload from a presentation", + operationId: "getPresentationMediaUpload", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'media_upload_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationMediaUpload") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationMediaUpload($summit_id, $presentation_id, $media_upload_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $media_upload_id) { @@ -912,12 +1360,36 @@ public function getPresentationMediaUpload($summit_id, $presentation_id, $media_ }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/media-uploads", + summary: "Add a media upload to a presentation", + operationId: "addPresentationMediaUpload", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationMediaUploadRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationMediaUpload") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addPresentationMediaUpload(LaravelRequest $request, $summit_id, $presentation_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id) { @@ -978,13 +1450,37 @@ public function addPresentationMediaUpload(LaravelRequest $request, $summit_id, }); } - /** - * @param LaravelRequest $request - * @param $summit_id - * @param $presentation_id - * @param $media_upload_id - * @return JsonResponse|mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/media-uploads/{media_upload_id}", + summary: "Update a media upload from a presentation", + operationId: "updatePresentationMediaUpload", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'media_upload_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema(ref: "#/components/schemas/PresentationMediaUploadRequest") + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationMediaUpload") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updatePresentationMediaUpload(LaravelRequest $request, $summit_id, $presentation_id, $media_upload_id) { return $this->processRequest(function () use ($request, $summit_id, $presentation_id, $media_upload_id) { @@ -1045,12 +1541,25 @@ public function updatePresentationMediaUpload(LaravelRequest $request, $summit_i }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $media_upload_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/media-uploads/{media_upload_id}", + summary: "Delete a media upload from a presentation", + operationId: "deletePresentationMediaUpload", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationMaterialsData, SummitScopes::WritePresentationSlidesData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'media_upload_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deletePresentationMediaUpload($summit_id, $presentation_id, $media_upload_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $media_upload_id) { @@ -1078,10 +1587,30 @@ public function deletePresentationMediaUpload($summit_id, $presentation_id, $med }); } - /** - * @param $summit_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/all/import/mux", + summary: "Import assets from MUX", + operationId: "importAssetsFromMUX", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/MuxImportRequest") + ), + responses: [ + new OA\Response(response: Response::HTTP_OK, description: "OK"), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function importAssetsFromMUX($summit_id) { return $this->processRequest(function () use ($summit_id) { @@ -1126,11 +1655,22 @@ public function importAssetsFromMUX($summit_id) * Attendees Votes */ - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/attendee-votes", + summary: "Get attendee votes for a presentation", + operationId: "getAttendeeVotes", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: Response::HTTP_OK, description: "OK"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getAttendeeVotes($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -1142,11 +1682,28 @@ public function getAttendeeVotes($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/attendee-votes", + summary: "Cast an attendee vote for a presentation", + operationId: "castAttendeeVote", + security: [['summit_presentations_auth' => [SummitScopes::Allow2PresentationAttendeeVote]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationVote") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function castAttendeeVote($summit_id, $presentation_id) { @@ -1173,11 +1730,24 @@ public function castAttendeeVote($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/attendee-votes", + summary: "Remove an attendee vote for a presentation", + operationId: "unCastAttendeeVote", + security: [['summit_presentations_auth' => [SummitScopes::Allow2PresentationAttendeeVote]]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function unCastAttendeeVote($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -1194,13 +1764,31 @@ public function unCastAttendeeVote($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $selection_plan_id - * @param $presentation_id - * @param $score_type_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/track-chair-scores/{score_type_id}", + summary: "Add a track chair score to a presentation", + operationId: "addTrackChairScore", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'selection_plan_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'score_type_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/PresentationTrackChairScore") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addTrackChairScore($summit_id, $selection_plan_id, $presentation_id, $score_type_id) { @@ -1229,13 +1817,27 @@ public function addTrackChairScore($summit_id, $selection_plan_id, $presentation }); } - /** - * @param $summit_id - * @param $selection_plan_id - * @param $presentation_id - * @param $score_type_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/track-chair-scores/{score_type_id}", + summary: "Remove a track chair score from a presentation", + operationId: "removeTrackChairScore", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'selection_plan_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'score_type_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function removeTrackChairScore($summit_id, $selection_plan_id, $presentation_id, $score_type_id) { @@ -1255,12 +1857,34 @@ public function removeTrackChairScore($summit_id, $selection_plan_id, $presentat }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $speaker_id - * @return JsonResponse|mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/speakers/{speaker_id}", + summary: "Add a speaker to a presentation", + operationId: "addSpeaker2Presentation", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationData, SummitScopes::WriteSpeakersData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'speaker_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: false, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSpeakerRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/Presentation") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addSpeaker2Presentation($summit_id, $presentation_id, $speaker_id) { @@ -1287,12 +1911,34 @@ public function addSpeaker2Presentation($summit_id, $presentation_id, $speaker_i }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $speaker_id - * @return JsonResponse|mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/speakers/{speaker_id}", + summary: "Update a speaker in a presentation", + operationId: "updateSpeakerInPresentation", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationData, SummitScopes::WriteSpeakersData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'speaker_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationSpeakerRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/Presentation") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updateSpeakerInPresentation($summit_id, $presentation_id, $speaker_id) { @@ -1322,12 +1968,26 @@ public function updateSpeakerInPresentation($summit_id, $presentation_id, $speak }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $speaker_id - * @return JsonResponse|mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/speakers/{speaker_id}", + summary: "Remove a speaker from a presentation", + operationId: "removeSpeakerFromPresentation", + security: [['summit_presentations_auth' => [SummitScopes::WritePresentationData, SummitScopes::WriteSpeakersData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'speaker_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function removeSpeakerFromPresentation($summit_id, $presentation_id, $speaker_id) { @@ -1349,11 +2009,31 @@ public function removeSpeakerFromPresentation($summit_id, $presentation_id, $spe use ParametrizedGetAll; - /** - * @param $summit_id - * @param $presentation_id - * @return JsonResponse - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/comments", + summary: "Get all comments from a presentation", + operationId: "getPresentationComments", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators, IGroup::TrackChairsAdmins, IGroup::TrackChairs]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'page', in: 'query', required: false, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'per_page', in: 'query', required: false, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'filter', in: 'query', required: false, schema: new OA\Schema(type: 'string')), + new OA\Parameter(name: 'order', in: 'query', required: false, schema: new OA\Schema(type: 'string')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedPresentationComments") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getComments($summit_id, $presentation_id) { @@ -1405,6 +2085,28 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) { ); } + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/comments/{comment_id}", + summary: "Get a comment from a presentation", + operationId: "getPresentationComment", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators, IGroup::TrackChairsAdmins, IGroup::TrackChairs]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'comment_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/SummitPresentationComment") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getComment($summit_id, $presentation_id, $comment_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $comment_id) { @@ -1427,12 +2129,26 @@ public function getComment($summit_id, $presentation_id, $comment_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $comment_id - * @return mixed - */ + #[OA\Delete( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/comments/{comment_id}", + summary: "Delete a comment from a presentation", + operationId: "deletePresentationComment", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators, IGroup::TrackChairsAdmins, IGroup::TrackChairs]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'comment_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: 204, description: "No Content"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function deleteComment($summit_id, $presentation_id, $comment_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $comment_id) { @@ -1446,11 +2162,34 @@ public function deleteComment($summit_id, $presentation_id, $comment_id) } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Post( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/comments", + summary: "Add a comment to a presentation", + operationId: "addPresentationComment", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators, IGroup::TrackChairsAdmins, IGroup::TrackChairs]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationCommentRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/SummitPresentationComment") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function addComment($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -1471,12 +2210,35 @@ public function addComment($summit_id, $presentation_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @param $comment_id - * @return mixed - */ + #[OA\Put( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/comments/{comment_id}", + summary: "Update a comment from a presentation", + operationId: "updatePresentationComment", + security: [['summit_presentations_auth' => [SummitScopes::WriteSummitData, SummitScopes::WriteEventData, SummitScopes::WritePresentationData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators, IGroup::TrackChairsAdmins, IGroup::TrackChairs]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'comment_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/PresentationCommentRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/SummitPresentationComment") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function updateComment($summit_id, $presentation_id, $comment_id) { return $this->processRequest(function () use ($summit_id, $presentation_id, $comment_id) { @@ -1497,11 +2259,30 @@ public function updateComment($summit_id, $presentation_id, $comment_id) }); } - /** - * @param $summit_id - * @param $presentation_id - * @return mixed - */ + #[OA\Get( + path: "/api/v1/summits/{id}/presentations/{presentation_id}/extra-questions", + summary: "Get extra question answers from a presentation", + operationId: "getPresentationsExtraQuestions", + security: [['summit_presentations_auth' => [SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData]]], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + tags: ['Presentations'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'presentation_id', in: 'path', required: true, schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'filter', in: 'query', required: false, schema: new OA\Schema(type: 'string'), description: 'Filter by selection_plan_id'), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedExtraQuestionAnswers") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] public function getPresentationsExtraQuestions($summit_id, $presentation_id) { return $this->processRequest(function () use ($summit_id, $presentation_id) { @@ -1562,4 +2343,4 @@ public function getPresentationsExtraQuestions($summit_id, $presentation_id) )); }); } -} \ No newline at end of file +} diff --git a/app/ModelSerializers/Summit/SummitEventSerializer.php b/app/ModelSerializers/Summit/SummitEventSerializer.php index f3b6b9f9a..0000549c3 100644 --- a/app/ModelSerializers/Summit/SummitEventSerializer.php +++ b/app/ModelSerializers/Summit/SummitEventSerializer.php @@ -122,7 +122,7 @@ class SummitEventSerializer extends SilverStripeSerializer ]; /** - * @param null $expand + * @param string|null $expand * @param array $fields * @param array $relations * @param array $params diff --git a/app/Swagger/Security/SummitPresentationsAuthSchema.php b/app/Swagger/Security/SummitPresentationsAuthSchema.php new file mode 100644 index 000000000..b4127f67a --- /dev/null +++ b/app/Swagger/Security/SummitPresentationsAuthSchema.php @@ -0,0 +1,35 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + SummitScopes::WriteEventData => 'Write Event Data', + SummitScopes::WritePresentationData => 'Write Presentation Data', + SummitScopes::WriteVideoData => 'Write Video Data', + SummitScopes::WritePresentationVideosData => 'Write Presentation Videos Data', + SummitScopes::WritePresentationLinksData => 'Write Presentation Links Data', + SummitScopes::WritePresentationSlidesData => 'Write Presentation Slides Data', + SummitScopes::WritePresentationMaterialsData => 'Write Presentation Materials Data', + SummitScopes::WriteSpeakersData => 'Write Speakers Data', + SummitScopes::Allow2PresentationAttendeeVote => 'Attendee Vote', + ], + ), + ], + ) +] +class SummitPresentationsAuthSchema {} diff --git a/app/Swagger/SummitPresentationAPISchemas.php b/app/Swagger/SummitPresentationAPISchemas.php new file mode 100644 index 000000000..03197ffc3 --- /dev/null +++ b/app/Swagger/SummitPresentationAPISchemas.php @@ -0,0 +1,514 @@ +