const Presigned_url_requestsService = require('../services/presigned_url_requests');
const Presigned_url_requestsDBApi = require('../db/api/presigned_url_requests');
const { createEntityRouter } = require('../factories/router.factory');

/**
 *  @swagger
 *  components:
 *    schemas:
 *      Presigned_url_requests:
 *        type: object
 *        properties:
 *          requested_key:
 *            type: string
 *          mime_type:
 *            type: string
 *          status:
 *            type: string
 *          requested_size_mb:
 *            type: number
 *          expires_at:
 *            type: string
 *            format: date-time
 */

/**
 *  @swagger
 * tags:
 *   name: Presigned_url_requests
 *   description: The Presigned_url_requests managing API
 */

/**
 *  @swagger
 *  /api/presigned_url_requests:
 *    post:
 *      security:
 *        - bearerAuth: []
 *      tags: [Presigned_url_requests]
 *      summary: Add new item
 *      requestBody:
 *        required: true
 *        content:
 *          application/json:
 *            schema:
 *              properties:
 *                data:
 *                  type: object
 *                  $ref: "#/components/schemas/Presigned_url_requests"
 *      responses:
 *        200:
 *          description: The item was successfully added
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        500:
 *          description: Some server error
 *    get:
 *      security:
 *        - bearerAuth: []
 *      tags: [Presigned_url_requests]
 *      summary: Get all presigned_url_requests
 *      responses:
 *        200:
 *          description: Presigned_url_requests list successfully received
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        500:
 *          description: Some server error
 */

/**
 *  @swagger
 *  /api/presigned_url_requests/{id}:
 *    put:
 *      security:
 *        - bearerAuth: []
 *      tags: [Presigned_url_requests]
 *      summary: Update the selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      requestBody:
 *        required: true
 *        content:
 *          application/json:
 *            schema:
 *              properties:
 *                id:
 *                  type: string
 *                data:
 *                  type: object
 *                  $ref: "#/components/schemas/Presigned_url_requests"
 *      responses:
 *        200:
 *          description: The item was successfully updated
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 *    delete:
 *      security:
 *        - bearerAuth: []
 *      tags: [Presigned_url_requests]
 *      summary: Delete the selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      responses:
 *        200:
 *          description: The item was successfully deleted
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 *    get:
 *      security:
 *        - bearerAuth: []
 *      tags: [Presigned_url_requests]
 *      summary: Get selected item
 *      parameters:
 *        - in: path
 *          name: id
 *          required: true
 *          schema:
 *            type: string
 *      responses:
 *        200:
 *          description: Selected item successfully received
 *        401:
 *          $ref: "#/components/responses/UnauthorizedError"
 *        404:
 *          description: Item not found
 *        500:
 *          description: Some server error
 */

module.exports = createEntityRouter(
  'presigned_url_requests',
  Presigned_url_requestsService,
  Presigned_url_requestsDBApi,
);
