swagger: "2.0"
info:
  description: "Oncolink content API2"
  version: "2.0.0"
  title: "OncolinkContentApi2"
host: "api-content.oncolink.org"
basePath: "/prod"
schemes:
  - "https"
paths:
  /content/item:
    get:
      produces:
        - "application/json"
      parameters:
        - name: "file_name"
          in: "query"
          required: true
          type: "string"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            requestId:
              type: "string"
        "400":
          description: "400 response"
          schema:
            $ref: "#/definitions/ErrorResponse"
          headers:
            requestId:
              type: "string"
        "204":
          description: "204 response"
          headers:
            requestId:
              type: "string"
      security:
        - api_key: []
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ContentItemApiFunction}/invocations'
        responses:
          default:
            statusCode: "400"
            responseParameters:
              method.response.header.requestId: "integration.response.header.cid"
          "2\\d{2}":
            statusCode: "200"
            responseParameters:
              method.response.header.requestId: "integration.response.header.cid"
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: "when_no_match"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        type: "mock"
        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: "'*'"
            responseTemplates:
              application/json: "{}\n"
        requestTemplates:
          application/json: "{\n  \"statusCode\" : 200\n}\n"
        passthroughBehavior: "when_no_match"

  /content/item/latest:
    get:
      produces:
        - "application/json"
      parameters:
        - name: "remote_id"
          in: "query"
          required: true
          type: "string"
        - name: "language"
          in: "query"
          required: true
          type: "string"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            requestId:
              type: "string"
        "400":
          description: "400 response"
          schema:
            $ref: "#/definitions/ErrorResponse"
          headers:
            requestId:
              type: "string"
        "204":
          description: "204 response"
          headers:
            requestId:
              type: "string"
      security:
        - api_key: [ ]
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ContentItemLatestApiFunction}/invocations'
        responses:
          default:
            statusCode: "400"
            responseParameters:
              method.response.header.requestId: "integration.response.header.cid"
          "2\\d{2}":
            statusCode: "200"
            responseParameters:
              method.response.header.requestId: "integration.response.header.cid"
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: "when_no_match"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        type: "mock"
        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: "'*'"
            responseTemplates:
              application/json: "{}\n"
        requestTemplates:
          application/json: "{\n  \"statusCode\" : 200\n}\n"
        passthroughBehavior: "when_no_match"

  /content/list:
    get:
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          schema:
            $ref: "#/definitions/ArrayOfContent"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
        "204":
          description: "204 response"
      security:
        - api_key: [ ]
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ContentListApiFunction}/invocations'
        responses:
          "2\\d{2}":
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Origin: "'*'"
        passthroughBehavior: "when_no_match"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
            Access-Control-Allow-Headers:
              type: "string"
      x-amazon-apigateway-integration:
        type: "mock"
        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: "'*'"
            responseTemplates:
              application/json: "{}\n"
        requestTemplates:
          application/json: "{\n  \"statusCode\" : 200\n}\n"
        passthroughBehavior: "when_no_match"

  /contenttype/list:
    get:
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          schema:
            $ref: "#/definitions/ArrayOfContentType"
        "204":
          description: "204 response"
      security:
        - api_key: []
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${ContentTypeListApiFunction}/invocations'
        responses:
          "2\\d{2}":
            statusCode: "200"
        passthroughBehavior: "when_no_match"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
      x-amazon-apigateway-integration:
        type: "mock"
        responses:
          default:
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'"
              method.response.header.Access-Control-Allow-Origin: "'*'"
            responseTemplates:
              application/json: "{}\n"
        requestTemplates:
          application/json: "{\n  \"statusCode\" : 200\n}\n"
        passthroughBehavior: "when_no_match"

  /language/list:
    get:
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          schema:
            $ref: "#/definitions/ArrayOfLanguage"
        "204":
          description: "204 response"
      security:
        - api_key: []
      x-amazon-apigateway-integration:
        type: "aws_proxy"
        httpMethod: "POST"
        uri:
          Fn::Sub: 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${LanguageListApiFunction}/invocations'
        responses:
          "2\\d{2}":
            statusCode: "200"
        passthroughBehavior: "when_no_match"
    options:
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "200 response"
          headers:
            Access-Control-Allow-Origin:
              type: "string"
            Access-Control-Allow-Methods:
              type: "string"
      x-amazon-apigateway-integration:
        type: "mock"
        responses:
          default:
            statusCode: "200"
            responseParameters:
              method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'"
              method.response.header.Access-Control-Allow-Origin: "'*'"
            responseTemplates:
              application/json: "{}\n"
        requestTemplates:
          application/json: "{\n  \"statusCode\" : 200\n}\n"
        passthroughBehavior: "when_no_match"
securityDefinitions:
  api_key:
    type: "apiKey"
    name: "x-api-key"
    in: "header"
definitions:
  ArrayOfContent:
    type: "array"
    items:
      $ref: "#/definitions/Content"
  ContentType:
    type: "object"
    properties:
      content_type_id:
        type: "integer"
      content_type_identifier:
        type: "string"
  Content:
    type: "object"
    properties:
      content_id:
        type: "integer"
        description: "CMS Object ID"
      content_type_id:
        type: "integer"
      content_type_identifier:
        type: "string"
      file_name:
        type: "string"
      key:
        type: "string"
      language:
        type: "string"
      name:
        type: "string"
      published:
        type: "integer"
      modified:
        type: "integer"
      remote_id:
        type: "string"
      version:
        type: "integer"
      keywords:
        type: "string"
      tbb_category:
        type: "string"
      tbb_pathway:
        type: "string"
      tbb_codes:
        type: "string"
      url:
        type: "string"
      archived:
        type: "boolean"
  ArrayOfContentType:
    type: "array"
    items:
      $ref: "#/definitions/ContentType"
  ArrayOfLanguage:
    type: "array"
    items:
      $ref: "#/definitions/Language"
  Language:
    type: "object"
    properties:
      language:
        type: "string"
  ErrorResponse:
    type: "object"
    properties:
      message:
        type: "string"
      status:
        type: "boolean"
        default: false
