swagger: "2.0"
info:
  version: "1.0"
  title: "Serverless - FCJ Document Management System"
basePath: "/dev"
schemes:
  - "https"
paths:
  /docs:
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DocsUpload.Arn}/invocations"
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: when_no_match
        httpMethod: POST #always POST
        type: aws_proxy
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        responses:
          default:
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Methods: "'POST, OPTIONS'"
              method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
              method.response.header.Access-Control-Allow-Origin: "'*'"
        requestTemplates:
          application/json: '{"statusCode": 200}'
        passthroughBehavior: "when_no_match"
        type: "mock"
  /docs/{id}:
    get:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DocsList.Arn}/invocations"
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: when_no_match
        httpMethod: POST #always POST
        type: aws_proxy
    delete:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DocsDelete.Arn}/invocations"
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: when_no_match
        httpMethod: POST #always POST
        type: aws_proxy
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        responses:
          default:
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Methods: "'GET, DELETE, OPTIONS'"
              method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
              method.response.header.Access-Control-Allow-Origin: "'*'"
        requestTemplates:
          application/json: '{"statusCode": 200}'
        passthroughBehavior: "when_no_match"
        type: "mock"
  /docs/{id}/gen:
    get:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GeneralInforGet.Arn}/invocations"
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: when_no_match
        httpMethod: POST #always POST
        type: aws_proxy
    post:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GeneralInforUpload.Arn}/invocations"
        responses:
          default:
            statusCode: 200
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: when_no_match
        httpMethod: POST #always POST
        type: aws_proxy
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "200 response"
          schema:
            $ref: "#/definitions/Empty"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        responses:
          default:
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'"
              method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
              method.response.header.Access-Control-Allow-Origin: "'*'"
        requestTemplates:
          application/json: '{"statusCode": 200}'
        passthroughBehavior: "when_no_match"
        type: "mock"