const Access_logsService = require('../services/access_logs');
const Access_logsDBApi = require('../db/api/access_logs');
const { createEntityRouter } = require('../factories/router.factory');

/**
 *  @swagger
 *  components:
 *    schemas:
 *      Access_logs:
 *        type: object
 *        properties:
 *          path:
 *            type: string
 *          ip_address:
 *            type: string
 *          user_agent:
 *            type: string
 */

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

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

/**
 *  @swagger
 *  /api/access_logs/{id}:
 *    put:
 *      security:
 *        - bearerAuth: []
 *      tags: [Access_logs]
 *      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/Access_logs"
 *      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: [Access_logs]
 *      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: [Access_logs]
 *      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(
  'access_logs',
  Access_logsService,
  Access_logsDBApi,
);
