swagger: '2.0'
info:
  title: API Specifications
  version: 0.0.1
host: qa-ows-territories.theorchard.io
basePath: /
schemes:
  - http
paths:
  '/complement/{standard}':
    get:
      parameters:
        - in: path
          name: standard
          required: true
          type: string
        - description: alpha-2 territory code
          in: query
          name: territory_code_a2
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: true
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - standard: Orch_1_2016
                  territory_code_a2: AF
                  orch_id: 17
                  territory_name: Afghanistan
                  continent: Asia
                  territory_code_a3: AFG
                  territory_code_numeric: 4
                - standard: Orch_1_2016
                  territory_code_a2: AX
                  orch_id: 201
                  territory_name: Åland Islands
                  continent: Europe
                  territory_code_a3: ALA
                  territory_code_numeric: 248
              pagination:
                type: standard
                offset: 0
                limit: 1000
                total_records: 241
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            HTTP 200 OK
            -----------
            Returns inverted countries given source and countries
        '404':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            404 Not found
        '500':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            500 Server error
      description: |
        Get inverted countries list
  '/conversion/{input_standard}/{output_standard}':
    get:
      parameters:
        - in: path
          name: input_standard
          required: true
          type: string
        - in: path
          name: output_standard
          required: true
          type: string
        - description: alpha-2 territory code.
          in: query
          name: territory_code_a2
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: true
          type: string
      responses:
        '200':
          examples:
            default:
              pagination:
                limit: 1000
                total_records: 3
                type: standard
                offset: 0
              items:
                - territory_name: 'Bonaire, Sint Eustatius and Saba'
                  territory_code_numeric: 535
                  standard: ISO_3166_1_2016
                  orch_id: 196
                  territory_code_a2: BQ
                  territory_code_a3: BES
                - territory_name: Curaçao
                  territory_code_numeric: 531
                  standard: ISO_3166_1_2016
                  orch_id: 196
                  territory_code_a2: CW
                  territory_code_a3: CUW
                - territory_name: Sint Maarten (Dutch part)
                  territory_code_numeric: 534
                  standard: ISO_3166_1_2016
                  orch_id: 196
                  territory_code_a2: SX
                  territory_code_a3: SXM
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            HTTP 200 OK
            -----------
            Return converted countries given source and target standard
        '404':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            404 Not found
        '500':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            500 Server error
      description: |
        Return converted countries given source and target standard
  /hello/:
    get:
      responses:
        '200':
          examples:
            default:
              status: ok
          description: |
            200 OK
      description: |
        Check the health of the application.
  /standards:
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: true
          type: string
      responses:
        '200':
          examples:
            default:
              pagination:
                type: standard
                total_records: 2
                offset: 0
                limit: 1000
              items:
                - Orch_1_2016
                - ISO_3166_1_2016
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: >
            HTTP 200 OK

            -----------

            Return response with JSON payload containing list of all standards,
            supported by the service.
        '404':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            404 Standard not found
        '500':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            500 Server error
      description: |
        Get all supported standards
  '/territory/{standard}':
    get:
      parameters:
        - in: path
          name: standard
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: true
          type: string
      responses:
        '200':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          examples:
            default:
              items:
                - standard: Orch_1_2016
                  territory_code_a2: AF
                  orch_id: 17
                  territory_name: Afghanistan
                  continent: Asia
                  territory_code_a3: AFG
                  territory_code_numeric: 4
                - standard: Orch_1_2016
                  territory_code_a2: AX
                  orch_id: 201
                  territory_name: Åland Islands
                  continent: Europe
                  territory_code_a3: ALA
                  territory_code_numeric: 248
              pagination:
                type: standard
                offset: 0
                limit: 1000
                total_records: 243
          description: >
            HTTP 200 OK

            -----------

            Return response with JSON payload containing list of territories for
            a given standard.
        '404':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            404 Standard not found
        '500':
          headers:
            Correlation-Id:
              description: >-
                uuid to correlate logs (echoes back correlation_id from request
                header)
              type: string
          description: |
            500 Server error
      description: |
        Return all territories in requested standard.
definitions: {}
securityDefinitions: {}
