swagger: "2.0"

info:
  version: 1.0.0
  title: API Specifications

schemes:
  - https
host: qa-ows-lyrics.theorchard.io
paths:
  /hello/:
    get:
      summary: Check the health of the application.
      responses:
        200:
          description: 200 OK
          examples:
            application/json: { "status": "ok" }
  /tracks/{track_id}/lyrics:
    get:
      summary: Fetch track lyrics.
      parameters:
        - in: path
          name: track_id
          required: true
          type: string
      responses:
        200:
          description: 200 OK
          examples:
            application/json: {
              "track_id": 555, "lyrics": "JSON escaped lyrics" }
        404:
          description: 404 Not found
    put:
      summary: Set track lyrics.
      parameters:
        - in: path
          name: track_id
          required: true
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PutTrackLyrics'
      responses:
        200:
          description: 200 OK
        400:
          description: 400 Validation error
    delete:
      summary: Delete track lyrics.
      parameters:
        - in: path
          name: track_id
          required: true
          type: string
      responses:
        200:
          description: 200 OK
        404:
          description: 404 Not found
  /tracks/lyrics:
    delete:
      summary: Delete track lyrics.
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/DeleteTrackLyrics'
      responses:
        200:
          description: 200 OK
    get:
      summary: Fetch bulk track lyrics.
      parameters:
        - in: query
          name: tuids
          required: true
          type: string
      responses:
        200:
          description: 200 OK
          examples:
            application/json: {
              "items":
                 [
                   {
                      "lyrics": "Some lyrics one",
                      "track_id": 26877417
                   },
                   {
                      "lyrics": "Some lyrics two",
                      "track_id": 26877418
                   }
                 ]
            }
        404:
              description: 404 Not found
  /tracks/copy:
    post:
      summary: Copy track lyrics.
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/CopyTrackLyrics'
      responses:
        200:
          description: 200 OK


definitions:
  PutTrackLyrics:
    properties:
      lyrics:
        type: string
    type: object
  DeleteTrackLyrics:
    properties:
      tuids:
        description: Track ids.
        items:
          minimum: 1
          type: integer
        type: array
    type: object
  CopyTrackLyrics:
    properties:
      items:
        description: Copy items.
        items:
          properties:
            source_tuid:
              minimum: 1
              type: integer
            destination_tuid:
              minimum: 1
              type: integer
          type: object
        type: array
    type: object
