swagger: '2.0'
info:
  title: Ows-prs API specifications
  version: 0.0.1
host: qa-ows-prs.theorchard.io
basePath: /
schemes:
  - http
tags:
  - name: Health Check
    description: Check the health of the application.
  - name: Performance Rights Services Operation
    description: Following are Performance Rights Services Operation.
paths:
  /hello:
    get:
      tags:
        - Health Check
      summary: Check the health of the application.
      description: Health check
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: "#/definitions/hello"
  /label-details:
    post:
      tags:
        - Performance Rights Services Operation
      summary: Generate the label details CSV and log the progress.
      consumes:
        - application/json
      produces:
        - application/json
      description: Get all the vendor level details.
      parameters:
        - in: header
          name: Correlation-Id
          required: false
          type: string
          description: Correlation-Id
        - in: body
          name: Request body
          schema:
            $ref: "#/definitions/label-details"
          description: Request body for label-details.
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: "#/definitions/label-details-200"
        '400':
          description: 400 Bad Request
          schema:
            $ref: "#/definitions/label-details-400"
        '404':
          description: 404 Not Found
          schema:
            $ref: "#/definitions/label-details-404"
        '500':
          description: 500 Internal server error
          schema:
            $ref: "#/definitions/label-details-500"
definitions:
  label-details:
    type: object
    required:
      - manual_label
    properties:
      country_id:
        type: integer
      ignore_rome:
        type: integer
      include_local_labels:
        type: integer
      check_blacklist:
        type: integer
      manual_label:
        type: string
      eligible_vendor_list:
        type: string
    example:
      {
        "country_id": 1,
        "ignore_rome": 0,
        "include_local_labels": 0,
        "check_blacklist": 1,
        "manual_label": "report for xyz",
        "eligible_vendor_list": "1234,7123"
      }
  label-details-200:
    type: object
    properties:
      s3_url:
        type: string
      message:
        type: string
    required:
      - s3_url
      - message
    example:
      {
        "s3_url": "https://bucket-name.s3.amazonaws.com/tool/filename.csv?AWSAccessKeyId=RANDOMKEY&Signature=RANDOMSIGN&Expires=1502967998",
        "message": "File Generated Successfully"
      }
  label-details-400:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
    required:
      - message
      - code
    example:
      {
        "message": "Invalid request body",
        "code": "bad_request"
      }
  label-details-404:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
    required:
      - message
      - code
    example:
      {
        "message": "Vendor not found",
        "code": "not_found_error"
      }
  label-details-500:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
    required:
      - message
      - code
    example:
      {
        "message": "Could not connect to MySQL",
        "code": "server_error"
      }
  hello:
    type: object
    example:
      {
        "status": "ok"
      }
securityDefinitions: {}
