parameters:
  - $ref: '../../parameters/applicationId.yml'
get:
  operationId: get-application
  summary: Antragsdaten abholen
  description: Ruft die Fachdaten und Metadaten eines wartenden Antrags ab.
  tags:
    - Application Retrieval
  security:
    - OAuth20:
        - 'destination:manage'
        - 'destination:subscribe'
  responses:
    '200':
      description: OK
      content:
        application/json:
          schema:
            $ref: '../../schemas/get-application-response.yml'
          examples:
            example-1:
              $ref: '../../examples/application-response.yml'
    '400':
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '401':
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '403':
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '404':
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
post:
  operationId: submit-application
  summary: Antrag einreichen
  description: Ruft eine wartende Application ab.
  tags:
    - Application Transfer
  security:
    - OAuth20:
        - 'destination:send'
  requestBody:
    required: true
    content:
      application/jose:
        schema:
          $ref: '../../schemas/submit-application-request.yml'
  responses:
    '202':
      description: Accepted
      content:
        application/json:
          schema:
            $ref: '../../schemas/get-application-response.yml'
          examples:
            example-1:
              $ref: '../../examples/application-response.yml'
    '400':
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '401':
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '403':
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '404':
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '413':
      description: Request Entity Too Large
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '415':
      description: Unsupported Media Type (wrong content type sent)
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '422':
      description: Validierung des Antrags schlug fehl
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
put:
  operationId: acknowledge-application
  summary: Abholung des Antrags bestätigen
  description: Antrag als abgeholt markieren
  tags:
    - Application Retrieval
  security:
    - OAuth20:
        - 'destination:subscribe'
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../../schemas/empty-body.yml'
        examples:
          example-1:
            $ref: '../../examples/empty-body.yml'
  responses:
    '200':
      description: OK
      content:
        application/json:
          schema:
            $ref: '../../schemas/empty-body.yml'
          examples:
            example-1:
              $ref: '../../examples/empty-body.yml'
    '400':
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '401':
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '403':
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
    '404':
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error-response.yml
