get:
    summary: Returns a list of (optionally filtered) contacts.
    description: Returns the list of (optionally filtered) contacts which are visible to the current subject or any of it's assumed roles.
    tags:
        - hs-office-contacts
    operationId: getListOfContacts
    parameters:
        - $ref: 'auth.yaml#/components/parameters/currentSubject'
        - $ref: 'auth.yaml#/components/parameters/assumedRoles'
        - name: caption
          in: query
          required: false
          schema:
              type: string
          description: Beginning of caption to filter the results.
        - name: emailAddress
          in: query
          required: false
          schema:
              type: string
          description:
              Email-address to filter the results, use '%' as wildcard.
    responses:
        "200":
            description: OK
            content:
                'application/json':
                    schema:
                        type: array
                        items:
                            $ref: 'hs-office-contact-schemas.yaml#/components/schemas/HsOfficeContact'
        "401":
            $ref: 'error-responses.yaml#/components/responses/Unauthorized'
        "403":
            $ref: 'error-responses.yaml#/components/responses/Forbidden'

post:
    summary: Adds a new contact.
    tags:
        - hs-office-contacts
    operationId: postNewContact
    parameters:
        - $ref: 'auth.yaml#/components/parameters/currentSubject'
        - $ref: 'auth.yaml#/components/parameters/assumedRoles'
    requestBody:
        content:
            'application/json':
                schema:
                    $ref: 'hs-office-contact-schemas.yaml#/components/schemas/HsOfficeContactInsert'
        required: true
    responses:
        "201":
            description: Created
            content:
                'application/json':
                    schema:
                        $ref: 'hs-office-contact-schemas.yaml#/components/schemas/HsOfficeContact'
        "401":
            $ref: 'error-responses.yaml#/components/responses/Unauthorized'
        "403":
            $ref: 'error-responses.yaml#/components/responses/Forbidden'
        "409":
            $ref: 'error-responses.yaml#/components/responses/Conflict'
