openapi: 3.0.0
info:
  contact:
    email: support@auerswald.de
    name: Auerswald
    url: www.auerswald.de/support
  description: This is the official api documentation for the d-serie products.
  license:
    name: License name
    url: www.auerswald.de/support/api
  termsOfService: www.auerswald.de
  title: D-Serie API
  version: 1.3.7
servers:
  - description: Hardwarename
    url: 'https://{url}:{port}/{basePath}/{apiVersion}'
    variables:
      url:
        default: 'localhost'
      basePath:
        default: api
      port:
        default: '80'
      apiVersion:
        default: v1
paths:
  /users:
    x-xpath: '/users'
    x-ref:
      name: users
      type: users
      returns: User
      include: true
    get:
      tags:
        - All
        - Get
        - Users
      description: Get a list of users
      responses:
        200:
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/users'
            application/xml:
              schema:
                $ref: '#/components/schemas/users'
  /users/{name}:
    x-xpath: '/users/user[@name="{name}"]'
    x-ref:
      name: user
      type: user
      returns: User
    parameters:
      - name: name
        in: path
        description: The name of the user to fetch
        required: true
        schema:
          type: string
    get:
      tags:
        - All
        - Get
        - Users
      description: Returns a single user
      responses:
        200:
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/user'
            application/xml:
              schema:
                $ref: '#/components/schemas/user'
        401:
          description: Unauthorized
        404:
          description: Not Found
    delete:
      tags:
        - All
        - Delete
        - Users
      description: Delete a user. The last user can not be deleted.
      responses:
        200:
          description: Operation successful
        401:
          description: Unauthorized
        404:
          description: Not Found
    put:
      tags:
        - All
        - Put
        - Users
      description: Update a single user
      responses:
        200:
          description: Operation successful
        400:
          $ref: '#/components/responses/BadRequest'
        401:
          description: Unauthorized
        404:
          description: Not Found
      requestBody:
        description: The user properties to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
          application/xml:
            schema:
              $ref: '#/components/schemas/user'
    post:
      tags:
        - All
        - Post
        - Users
      description: Create a single user
      responses:
        200:
          description: Operation successful
        400:
          $ref: '#/components/responses/BadRequest'
        403:
          description: Forbidden
      requestBody:
        description: The user object to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
          application/xml:
            schema:
              $ref: '#/components/schemas/user'
  /users/primary:
    x-xpath: '/users/user[role="user"]'
    x-ref:
      name: PrimaryUser
      type: user
      returns: User
    get:
      tags:
        - All
        - Get
        - Users
      description: Returns a single user
      responses:
        200:
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/user'
            application/xml:
              schema:
                $ref: '#/components/schemas/user'
        401:
          description: Unauthorized
        404:
          description: Not Found
    put:
      tags:
        - All
        - Put
        - Users
      description: Update a single user
      responses:
        200:
          description: Operation successful
        400:
          $ref: '#/components/responses/BadRequest'
        401:
          description: Unauthorized
        404:
          description: Not Found
      requestBody:
        description: The user properties to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
          application/xml:
            schema:
              $ref: '#/components/schemas/user'
  /users/useradd:
    x-xpath: '/users/user[count(*) +1]'
    x-ref:
      name: NextUser
      type: user
    post:
      tags:
        - All
        - Post
        - Users
      description: Create a single user
      responses:
        200:
          description: Operation successful
        400:
          $ref: '#/components/responses/BadRequest'
        403:
          description: Forbidden
      requestBody:
        description: The user object to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user'
          application/xml:
            schema:
              $ref: '#/components/schemas/user'
  /contacts:
    x-xpath: '/contacts'
    x-ref:
      name: contacts
      type: contacts
      returns: contacts
      include: true
    get:
      tags:
        - All
        - Get
        - Contacts
      description: Get a contacts setup
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts'
            application/xml:
              schema:
                $ref: '#/components/schemas/contacts'
        '400':
          $ref: '#/components/responses/BadRequest'
    post:
      tags:
        - All
        - Post
        - Contacts
      description: Create a contacts setup
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        description: The setting values for a contacts setup
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contacts'
          application/xml:
            schema:
              $ref: '#/components/schemas/contacts'
    put:
      tags:
        - All
        - Put
        - Contacts
      description: Update a contacts settings
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        description: The setting values for a ldap setup
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contacts'
          application/xml:
            schema:
              $ref: '#/components/schemas/contacts'
    delete:
      tags:
        - All
        - Delete
        - Contacts
      description: Delete a contacts setup
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
  /keys:
    x-xpath: /keys
    x-ref:
      include: true
      name: keys
      type: keys
      returns: Keys
    get:
      tags:
        - All
        - Get
        - Keys
      description: Get all configured keys
      responses:
        '200':
          description: A list of all groups and their configured keys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/keys'
            application/xml:
              schema:
                $ref: '#/components/schemas/keys'
  /keys/{group}:
    x-xpath: '/keys/{group}'
    x-ref:
      name: groupedKeys
      type: groupedKeys
      returns: Key
    parameters:
      - name: group
        in: path
        description: The group the key belongs to.
        required: true
        schema:
          $ref: '#/components/schemas/keyGroup'
    get:
      tags:
        - All
        - Get
        - Keys
      description: Get all keys for the specified group.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/groupedKeys'
            application/xml:
              schema:
                $ref: '#/components/schemas/groupedKeys'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
  /keys/{group}/{keyNumber}:
    x-xpath: '/keys/{group}/key[@keyNumber={keyNumber}]'
    x-ref:
      name: key
      type: key
      returns: Key
    parameters:
      - name: group
        in: path
        description: The group the key belongs to.
        required: true
        schema:
          $ref: '#/components/schemas/keyGroup'
      - name: keyNumber
        in: path
        description: The position of the key in the specified group.
        required: true
        schema:
          type: integer
          format: int32
          minimum: 1
    get:
      tags:
        - All
        - Get
        - Keys
      description: Get the key on the specified position
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/key'
            application/xml:
              schema:
                $ref: '#/components/schemas/key'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
    post:
      tags:
        - All
        - Post
        - Keys
      description: Create a new key on the specified position
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
      requestBody:
        description: The config values for the key
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/key'
          application/xml:
            schema:
              $ref: '#/components/schemas/key'
    delete:
      tags:
        - All
        - Delete
        - Keys
      description: Delete the key on the specified position in the group
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
    put:
      tags:
        - All
        - Put
        - Keys
      description: Update the key on the specified position in the group
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
      requestBody:
        description: The updated configuration for the key
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/key'
          application/xml:
            schema:
              $ref: '#/components/schemas/key'
  /keyLayer:
    x-xpath: '/keyLayer'
    x-ref:
      include: true
      name: 'keyLayer'
      type: 'keyLayer'
      returns: 'KeyLayer'
    get:
      tags:
        - All
        - Get
        - KeyLayer
      description: Get the keylayer settings
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/keyLayer'
           application/xml:
             schema:
               $ref: '#/components/schemas/keyLayer'
       '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - KeyLayer
      description: Set the keylayer settings
      responses:
        '200':
          description: Operation successful
      requestBody:
        description: The keyLayer values
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/keyLayer'
          application/xml:
            schema:
              $ref: '#/components/schemas/keyLayer'
  /identities:
    x-xpath: /identities
    x-ref:
      include: true
      name: identities
      type: identities
      returns: Identity
    get:
      tags:
        - All
        - Get
        - Identities
      description: Get the list of identities
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/identities'
            application/xml:
              schema:
                $ref: '#/components/schemas/identities'
  /identities/{idx}:
    x-xpath: '/identities/identity[{idx}]'
    x-ref:
      name: identity
      type: identity
      returns: Identity
    parameters:
      - name: idx
        in: path
        description: The index of the identity.
        required: true
        schema:
          type: integer
          format: int32
          minimum: 1
    get:
      tags:
        - All
        - Get
        - Identities
      description: Get the specified identity at the index.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/identity'
            application/xml:
              schema:
                $ref: '#/components/schemas/identity'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Identities
      description: Update the identity at the specified index.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/identity'
          application/xml:
            schema:
              $ref: '#/components/schemas/identity'
  /telephony:
    x-xpath: /telephony
    x-ref:
      include: true
      name: telephony
      type: telephony
      returns: Telephony
    get:
      tags:
        - All
        - Get
        - Telephony
      description: Get the telephony settings.
      responses:
        '200':
          description: Operation successfull
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/telephony'
            application/xml:
              schema:
                $ref: '#/components/schemas/telephony'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Telephony
      description: Update the telephony settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/telephony'
          application/xml:
            schema:
              $ref: '#/components/schemas/telephony'
  /sound:
    x-xpath: /sound
    x-ref:
      include: true
      name: sound
      type: sound
      returns: Sound
    get:
      tags:
        - All
        - Get
        - Sound
      description: Get the sound settings.
      responses:
        '200':
          description: Operation successfull
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sound'
            application/xml:
              schema:
                $ref: '#/components/schemas/sound'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Sound
      description: Update the sound settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sound'
          application/xml:
            schema:
              $ref: '#/components/schemas/sound'
  /provisioning:
    x-xpath: /provisioning
    x-ref:
      include: true
      name: provisioning
      type: provisioning
      returns: Provisioning
    get:
      tags:
        - All
        - Get
        - Provisioning
      description: Get the provisionings settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/provisioning'
            application/xml:
              schema:
                $ref: '#/components/schemas/provisioning'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Provisioning
      description: Update the provisioning settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/provisioning'
          application/xml:
            schema:
              $ref: '#/components/schemas/provisioning'
  /update:
    x-xpath: /update
    x-ref:
      include: true
      name: update
      type: update
      returns: Update
    get:
      tags:
        - All
        - Get
        - Update
      description: Get the update settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update'
            application/xml:
              schema:
                $ref: '#/components/schemas/update'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Update
      description: Update the update settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update'
          application/xml:
            schema:
              $ref: '#/components/schemas/update'
  /locales:
    x-xpath: /locales
    x-ref:
      include: true
      name: locales
      type: locales
      returns: Locales
    get:
      tags:
        - All
        - Get
        - Locales
      description: Get the locale settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/locales'
            application/xml:
              schema:
                $ref: '#/components/schemas/locales'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Locales
      description: Update the locale settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/locales'
          application/xml:
            schema:
              $ref: '#/components/schemas/locales'
  /network:
    x-xpath: /network
    x-ref:
      include: true
      name: network
      type: network
      returns: Network
    get:
      tags:
        - All
        - Get
        - Network
      description: Get the network settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/network'
            application/xml:
              schema:
                $ref: '#/components/schemas/network'
        '400':
          $ref: '#/components/responses/BadRequest'
  /network/ethernet:
    x-xpath: /network/ethernet
    x-ref:
      name: ethernet
      type: ethernet
      returns: Ethernet
    get:
      tags:
        - All
        - Get
        - Network
      description: Get the ethernet settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ethernet'
            application/xml:
              schema:
                $ref: '#/components/schemas/ethernet'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Network
      description: Update the ethernet settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ethernet'
          application/xml:
            schema:
              $ref: '#/components/schemas/ethernet'
  /network/vpn:
    x-xpath: /network/vpn
    x-ref:
      name: vpn
      type: vpn
      returns: Vpn
    get:
      tags:
        - All
        - Get
        - Network
        - VPN
      description: Get the vpn settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/vpn'
            application/xml:
              schema:
                $ref: '#/components/schemas/vpn'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Network
      description: Update the vpn settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/vpn'
          application/xml:
            schema:
              $ref: '#/components/schemas/vpn'
  /userInterface/display:
    x-xpath: '/userInterface/display'
    x-ref:
      include: true
      name: 'display'
      type: 'display'
      returns: 'Display'
    get:
      tags:
        - All
        - Get
        - Display
      description: Get the display settings.
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/display'
           application/xml:
             schema:
               $ref: '#/components/schemas/display'
       '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Display
      description: Update the display settings.
      responses:
        '200':
          description: Operation successful
      requestBody:
        description: The display values
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/display'
          application/xml:
            schema:
              $ref: '#/components/schemas/display'
  /userInterface:
    x-xpath: '/userInterface'
    x-ref:
      include: true
      name: 'userInterface'
      type: 'userInterface'
      returns: 'UserInterface'
    get:
      tags:
        - All
        - Get
        - UserInterface
      description: Get settings for the user-interface.
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/userInterface'
           application/xml:
             schema:
               $ref: '#/components/schemas/userInterface'
       '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - UserInterface
      description: Update settings for the user-interface.
      responses:
        '200':
          description: Operation successful
      requestBody:
        description: The user-interface values
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/userInterface'
          application/xml:
            schema:
              $ref: '#/components/schemas/userInterface'
  /templates:
    x-xpath: /templates
    x-ref:
      include: true
      name: templates
      type: templates
      returns: Template
    get:
      tags:
        - All
        - Get
        - Templates
      description: Get all templates
      responses:
        '200':
          description: A list of available key templates.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/templates'
            application/xml:
              schema:
                $ref: '#/components/schemas/templates'
  /templates/{name}:
    x-xpath: '/templates/template[@name="{name}"]'
    x-ref:
      name: template
      type: template
      returns: Template
    parameters:
      - name: name
        in: path
        description: The name of the template
        required: true
        schema:
          type: string
    get:
      tags:
        - All
        - Get
        - Templates
      description: Get the template with the specified name.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template'
            application/xml:
              schema:
                $ref: '#/components/schemas/template'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
    put:
      tags:
        - All
        - Put
        - Templates
      description: Update the template with the specified name.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/template'
          application/xml:
            schema:
              $ref: '#/components/schemas/template'
  /remoteAccess:
    x-xpath: /remoteAccess
    x-ref:
      include: true
      name: remoteAccess
      type: remoteAccess
      returns: RemoteAccess
    get:
      tags:
        - All
        - Get
        - RemoteAccess
      description: Get the remote-access settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/remoteAccess'
            application/xml:
              schema:
                $ref: '#/components/schemas/remoteAccess'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - RemoteAccess
      description: Update the remote-access settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/remoteAccess'
          application/xml:
            schema:
              $ref: '#/components/schemas/remoteAccess'
  /apps:
    x-xpath: /apps
    x-ref:
      include: true
      name: apps
      type: apps
      returns: Apps
    get:
      tags:
        - All
        - Get
        - Apps
      description: Get the apps-settings.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apps'
            application/xml:
              schema:
                $ref: '#/components/schemas/apps'
        '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Apps
      description: Update the apps-settings.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/apps'
          application/xml:
            schema:
              $ref: '#/components/schemas/apps'
  /timeAndDate:
    x-xpath: '/timeAndDate'
    x-ref:
      include: true
      name: 'timeAndDate'
      type: 'timeAndDate'
      returns: 'TimeAndDate'
    get:
      tags:
        - All
        - Get
        - TimeAndDate
      description: Get the timeAndDate settings.
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/timeAndDate'
           application/xml:
             schema:
               $ref: '#/components/schemas/timeAndDate'
       '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - TimeAndDate
      description: Update the timeAndDate settings
      responses:
        '200':
          description: Operation successful
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/timeAndDate'
          application/xml:
            schema:
              $ref: '#/components/schemas/timeAndDate'
  /logging:
    x-xpath: '/logging'
    x-ref:
      include: true
      name: 'logging'
      type: 'logging'
      returns: 'Logging'
    get:
      tags:
        - All
        - Get
        - Logging
      description: Get the logging settings.
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/logging'
           application/xml:
             schema:
               $ref: '#/components/schemas/logging'
       '400':
          $ref: '#/components/responses/BadRequest'
    put:
      tags:
        - All
        - Put
        - Logging
      description: Set the logging settings.
      responses:
        '200':
          description: Operation successful
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/logging'
          application/xml:
            schema:
              $ref: '#/components/schemas/logging'
  /luaLibraries:
    x-xpath: '/luaLibraries'
    x-ref:
      include: true
      name: 'luaLibraries'
      type: 'luaLibraries'
      returns: 'LuaLibrary'
    get:
      tags:
        - All
        - Get
        - LuaLibraries
      description: Get the luaLibraries settings.
      responses:
       '200':
         description: Operation successful
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/luaLibraries'
           application/xml:
             schema:
               $ref: '#/components/schemas/luaLibraries'
       '400':
          $ref: '#/components/responses/BadRequest'
  /luaLibraries/{name}:
    x-xpath: '/luaLibraries/luaLibrary[@name="{name}"]'
    x-ref:
      name: luaLibrary
      type: luaLibrary
      returns: LuaLibrary
    parameters:
      - name: name
        in: path
        description: The name of the luaLibrary
        required: true
        schema:
          type: string
    get:
      tags:
        - All
        - Get
        - LuaLibraries
      description: Get the luaLibrary with the specified name.
      responses:
        '200':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/luaLibrary'
            application/xml:
              schema:
                $ref: '#/components/schemas/luaLibrary'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
    put:
      tags:
        - All
        - Put
        - LuaLibraries
      description: Update the luaLibrary with the specified name.
      responses:
        '200':
          description: Operation successful
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: NotFound
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/luaLibrary'
          application/xml:
            schema:
              $ref: '#/components/schemas/luaLibrary'
components:
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AppError'
    IllegalInput:
      description: Illegal input for operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AppError'
  schemas:
    AppError:
      type: object
      properties:
        code:
          type: integer
          format: int32
          minimum: 0
          exclusiveMinimum: true
        message:
          type: string
        request_id:
          type: string
    users:
      description: A list of all users
      type: array
      items:
        $ref: '#/components/schemas/user'
      xml:
        wrapped: true
    user:
      description: A single user
      x-name: user
      x-id-attribute: name
      type: object
      required:
        - name
        - password
        - role
      properties:
        name:
          description: |
            The name of the user is at the same time
            the unique id.
          type: string
          pattern: ^[^:]*$
          xml:
            attribute: true
        password:
          description: |
            The password for the user.
            If the password is provisioned, you have to
            supply a hashed password.
            You can create a compatible hash using the
            tool provided in the web interface
            at the following url:
            `https:
            Over the api, you send the password over HTTPS
            in clear text, where it gets hashed in the
            webserver.
          type: string
          format: password
          minLength: 8
        role:
          $ref: '#/components/schemas/role'
        image:
          description: |
            The image for the user, base64 encoded.
            The image should not exceed 300x300px.
          type: string
          format: byte
        changePassword:
          description: |
            Indicates whether a user has to change his password.
            This flag will only be evaluated by client side logins
            and any tool handling the login should honour it.
          type: boolean
    role:
      x-name: role
      description: |
        The role for the user.
        an admin is allowed to do everything.
        A user is not allowed to configure anything by default,
        additional rights for the user have to be explicitly granted
      type: string
      default: user
      enum:
        - user
        - admin
    rights:
      description: |
        A list of xpath values which are supposed to
        serve as either a white or blacklist.
      type: array
      items:
        type: string
    contacts:
      type: object
      description: Describes a contacts setup
      properties:
        ldap:
          $ref: '#/components/schemas/ldap'
        orderBy:
          $ref: '#/components/schemas/orderNameBy'
    ldap:
      type: object
      description: Describes a ldap setup
      x-name: ldap
      required:
        - server
        - username
        - password
      properties:
        active:
          description: use this service or not
          type: boolean
          default: false
        server:
          description: ldap server address fqdn or ip address
          type: string
        ldapProtocol:
          $ref: '#/components/schemas/ldapProtocol'
        port:
          description: ldap server port 389 or 636 (LDAPS)
          type: integer
          format: int32
          minimum: 1
          maximum: 65535
          default: 389
        ldapVersion:
          description: ldap protocol version 2 or 3
          $ref: '#/components/schemas/ldapVersion'
        username:
          description: username to login
          type: string
        password:
          description: The password to authenticate the for the ldap server
          type: string
          format: password
        nameFilter:
          description: name filter according to RFC2254
          type: string
          default: (|(cn=%*)(sn=%*)(givenName=%*))
        numberFilter:
          description: number filter according to RFC2254 for reverse number lookup
          type: string
          default: (|(telephoneNumber=*%)(mobile=*%)(homePhone=*%))
        dialerNumberFilter:
          description: number filter according to RFC2254 for the number suggestion list in the dialer
          type: string
          default: (|(telephoneNumber=*%*)(mobile=*%*)(homePhone=*%*))
        baseDN:
          description: in what scope will be used searched
          type: string
        maxHits:
          description: maximum result entries
          type: integer
          format: int32
          minimum: 1
          maximum: 32000
          default: 20
        nameAttributes:
          description: what names are you looking for
          type: string
          default: cn sn givenName company o
        numberAttributes:
          description: what numbers are you looking for
          type: string
          default: mobile telephoneNumber homePhone
        reverseNumberLookupIncoming:
          description: find contact by incoming call number
          type: boolean
          default: true
        reverseNumberLookupOutgoing:
          description: find contact by outgoing call number
          type: boolean
          default: true
    ldapProtocol:
      description: ldap lts modes
      x-name: ldapProtocol
      type: string
      default: ldap
      enum:
        - ldap
        - ldapStartTls
        - ldaps
    ldapVersion:
      description: LDAP protocol version
      x-name: ldapVersion
      type: string
      default: three
      enum:
        - two
        - three
    orderNameBy:
      description: name sorting order for contact query results
      x-name: orderNameBy
      type: string
      default: orderByFirstname
      enum:
        - orderByFirstname
        - orderByLastname
    keyLayer:
      description: "3 layer of function keys"
      type: object
      properties:
        phoneXtensions:
          $ref: '#/components/schemas/xtensionKeyLayer'
        extensionModule1:
          $ref: '#/components/schemas/xtensionKeyLayer'
        extensionModule2:
          $ref: '#/components/schemas/xtensionKeyLayer'
        extensionModule3:
          $ref: '#/components/schemas/xtensionKeyLayer'
    xtensionKeyLayer:
          type: integer
          format: int32
          minimum: 1
          maximum: 3
          default: 1
    keys:
      description: "All keys that can be configured"
      type: object
      properties:
        phoneXtensions:
          type: array
          minItems: 0
          maxItems: 18
          description: "On D-100/D-200: 18 (3x6) self-labeling Xtension keys in idle-screen."
          items:
            $ref: '#/components/schemas/key'
          xml:
            wrapped: true
        extensionModule1:
          $ref: '#/components/schemas/xtensionKeys'
        extensionModule2:
          $ref: '#/components/schemas/xtensionKeys'
        extensionModule3:
          $ref: '#/components/schemas/xtensionKeys'
        homeScreen:
          $ref: '#/components/schemas/softKeys'
    xtensionKeys:
      description: "60 Xtension keys on an extension module."
      type: array
      minItems: 0
      maxItems: 60
      items:
        $ref: '#/components/schemas/key'
      xml:
        wrapped: true
    softKeys:
      description: 4 keys below the display
      type: array
      minItems: 4
      maxItems: 4
      items:
        $ref: '#/components/schemas/key'
      xml:
        wrapped: true
    groupedKeys:
      description: abstracted version of a collection of keys without any upper bound
      type: array
      items:
        $ref: '#/components/schemas/key'
      xml:
        wrapped: true
    keyGroup:
      description: The group a key belongs to
      x-name: keyGroupEnum
      type: string
      enum:
        - mainModule # not available in provisioning, only in here to keep index in sync wth c-code
        - phoneXtensions
        - extensionModule1
        - extensionModule2
        - extensionModule3
        - homeScreen
    key:
      type: object
      description: Describes a single functionkey
      x-name: key
      x-id-attribute: keyNumber
      required:
        - keyNumber
      properties:
        keyNumber:
          description: The number of the key
          type: integer
          format: int32
          minimum: 1
          exclusiveMinimum: false
          xml:
            attribute: true
        label:
          description: |
            The name of the key.
            If starting with @string/ a android resouce is used.
          type: string
          xml:
            attribute: true
        info:
          description: |
            Detail info of the key mostly displayed on a second line
            If starting with @string/ a android resouce is used.
          type: string
          xml:
            attribute: true
        icon:
          description: |
            The icon of the key, base64 encoded.
            The icon is scaled to fit the display container.
            If starting with @drawable/ a android resource is used
          type: string
          format: byte
          xml:
            attribute: true
        keyConfiguration:
          $ref: '#/components/schemas/keyConfiguration'
        templateName:
          description: |
            Reference to the text element of the template name.
          type: string
    keyConfiguration:
      type: object
      x-name: keyConfiguration
      description: |
        Various configuration parameters for a functionkey.
        This can either be:
        - lua code
        - a line
        - a list of functions assigned to the key
      oneOf:
        - type: object
          properties:
            lua:
              $ref: '#/components/schemas/luaContent'
        - type: object
          properties:
            line:
              $ref: '#/components/schemas/line'
        - type: object
          properties:
            function:
              $ref: '#/components/schemas/keyFunction'
    keyFunction:
      type: object
      x-name: keyFunction
      description: |
        Describes a single function for a functionkey.
        This can any one (or both) of:
        - a reaction to something
        - invoking an action
      anyOf:
        - $ref: '#/components/schemas/keyReactions'
        - $ref: '#/components/schemas/keyInvocations'
    keyReactions:
      type: array
      description: An array of possible reactions for a functionkey
      minItems: 0
      items:
        $ref: '#/components/schemas/keyReaction'
      xml:
        name: reactions
        wrapped: true
    keyReaction:
      type: object
      x-name: keyReaction
      xml:
        name: reaction
      description: A reaction for a functionkey
      oneOf:
        - type: object
          properties:
            ledSetting:
              $ref: '#/components/schemas/ledSetting'
        - type: object
          properties:
            presence:
              $ref: '#/components/schemas/presence'
    presence:
      type: object
      x-name: presence
      required:
        - subscribe
      properties:
        subscribe:
          $ref: '#/components/schemas/subscribe'
    subscribe:
      type: object
      x-name: subscribe
      required:
        - uri
        - type
      properties:
        uri:
          $ref: '#/components/schemas/uri'
        line:
          description: |
            If left out, the first available line is used.
          $ref: '#/components/schemas/line'
        listenFor:
          type: string
          description: |
            If the subscribeType is dialog, you can specify here
            what to listen for. In every other case, this option
            is ignored.
        type:
          $ref: '#/components/schemas/subscribeType'
          xml:
            attribute: true
    subscribeType:
      x-name: subscribeType
      type: string
      description: The type of the subscription
      default: dialog
      enum:
        - dialog
        - mwi
        - as_feature
        - check_sync
        - broadsoft_talk
        - broadsoft_hold
        - count
    ledSetting:
      type: object
      x-name: ledSetting
      description: LED reactions for a key
      properties:
        ledColor:
          $ref: '#/components/schemas/ledColor'
          xml:
            attribute: true
        ledBlinking:
          $ref: '#/components/schemas/ledBlinking'
          xml:
            attribute: true
    keyInvocations:
      type: array
      description: An array of possible actions for a functionkey
      minItems: 1
      items:
        $ref: '#/components/schemas/keyInvocation'
      xml:
        name: invocations
        wrapped: true
    keyInvocation:
      x-name: keyInvocation
      xml:
        name: invocation
      type: object
      description: |
        An action for a functionkey.
        This can either be:
        - A HTTP request
        - A dialogMessage
      oneOf:
        - type: object
          properties:
            http:
              $ref: '#/components/schemas/keyHttpRequest'
        - type: object
          properties:
            setting:
              $ref: '#/components/schemas/keySetting'
        - type: object
          properties:
            dialog:
              $ref: '#/components/schemas/dialogMessage'
        - type: object
          properties:
            invite:
              $ref: '#/components/schemas/keyInvite'
        - type: object
          properties:
            intent:
              $ref: '#/components/schemas/keyIntent'
    keyInvite:
      type: object
      x-name: keyInvite
      required:
        - uri
      properties:
        uri:
          $ref: '#/components/schemas/uri'
        line:
          $ref: '#/components/schemas/line'
        hidden:
          description: do invisible call
          type: boolean
          default: false
          xml:
             attribute: true
    keyIntent:
      type: object
      x-name: keyIntent
      required:
        - action
      properties:
        action:
          type: string
        data:
          $ref: '#/components/schemas/uri'
        component:
          $ref: '#/components/schemas/component'
        extras:
          $ref: '#/components/schemas/bundle'
    component:
      type: string
    bundle:
      type: array
      x-name: bundle
      description: |
        A map of `'string': bool | int | string`
      items:
        oneOf:
          - type: object
            allOf:
              - $ref: '#/components/schemas/bundle_key'
              - type: object
                properties:
                  value:
                    type: boolean
                    xml:
                      attribute: true
            xml:
              name: booleanExtra
          - type: object
            allOf:
              - $ref: '#/components/schemas/bundle_key'
              - type: object
                properties:
                  value:
                    type: integer
                    format: int64
                    xml:
                      attribute: true
            xml:
              name: intExtra
          - type: object
            allOf:
              - $ref: '#/components/schemas/bundle_key'
              - type: object
                properties:
                  value:
                    type: string
                    xml:
                      attribute: true
            xml:
              name: stringExtra
    bundle_key:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          xml:
            attribute: true
    keySetting:
      type: object
      x-name: keySetting
      required:
        - path
        - value
      properties:
        path:
          $ref: '#/components/schemas/uri'
          xml:
            attribute: true
        values:
          type: array
          minItems: 1
          items:
            type: object
            allOf:
              - type: object
                properties:
                  value:
                    type: string
              - type: object
                properties:
                  led:
                    $ref: '#/components/schemas/ledSetting'
        other:
          $ref: '#/components/schemas/ledSetting'
    line:
      x-name: line
      type: object
      required:
        - id
      properties:
        id:
          type: string
        component:
          $ref: '#/components/schemas/component'
    dialogMessage:
      type: string
      description: Creates a message dialog on the screen.
    keyHttpRequest:
      type: object
      x-JMembersHbGenerated: true
      x-name: keyHttpRequest
      description: |
        A HTTP request action that can be triggered by pressing a functionkey.
      allOf:
        - type: object
          properties:
            request:
              $ref: '#/components/schemas/httpRequest'
        - type: object
          properties:
            httpReactions:
              $ref: '#/components/schemas/httpReactions'
    httpReactions:
      type: array
      x-name: httpReactions
      xml:
        wrapped: true
      minItems: 1
      items:
        oneOf:
          - $ref: '#/components/schemas/httpReactionResponseCode'
          - $ref: '#/components/schemas/httpReactionResponseHeader'
    httpReactionResponseCode:
      type: object
      x-JMembersHbGenerated: true
      x-name: httpReactionResponseCode
      xml:
        name: responseCode
      allOf:
        - type: object
          properties:
            responseCode:
              type: integer
              format: int32
              minimum: 0
            dialogMessage:
              $ref: '#/components/schemas/dialogMessage'
              xml:
                attribute: true
        - $ref: '#/components/schemas/ledSetting'
    httpReactionResponseHeader:
      type: object
      x-JMembersHbGenerated: true
      x-name: httpReactionResponseHeader
      xml:
        name: responseHeader
      allOf:
        - type: object
          properties:
            dialogMessage:
              $ref: '#/components/schemas/dialogMessage'
              xml:
                attribute: true
        - $ref: '#/components/schemas/ledSetting'
        - $ref: '#/components/schemas/httpHeader'
    httpRequest:
      type: object
      x-name: httpRequest
      description: A HTTP Request
      required:
        - httpMethod
      properties:
        httpHeader:
          $ref: '#/components/schemas/httpHeader'
        httpMethod:
          $ref: '#/components/schemas/httpMethod'
          xml:
            attribute: true
        uri:
          $ref: '#/components/schemas/uri'
        httpContent:
          $ref: '#/components/schemas/httpContent'
    httpContent:
      description: The content of an HTTP request
      type: string
    uri:
      type: string
    httpMethod:
      description: Possible HTTP Methods like `GET` or `POST`
      type: string
      default: get
      enum:
        - get
        - post
        - delete
        - put
        - patch
    ledBlinking:
      type: boolean
      description: Whether the LED should blink or not.
      default: false
    luaContent:
      x-name: luaContent
      type: object
      required:
        - code
      properties:
        code:
          $ref: '#/components/schemas/luaCode'
        params:
          type: array
          items:
            $ref: '#/components/schemas/luaParam'
          xml:
            wrapped: true
    luaParam:
      xml:
        name: param
      x-name: luaParam
      description: A parameter for lua scripts to be set by the template.
      type: object
      properties:
        name:
          type: string
          xml:
            attribute: true
        value:
          type: string
      required:
        - name
    luaCode:
      x-name: luaCode
      description: Lua code to be executed for functionkeys.
      type: string
    ledColor:
      description: |
        The possible values a LED can have.
        These are probably not supported on all LEDs.
      type: string
      x-name: ledColor
      default: 'off'
      enum:
        - 'off'
        - red
        - orange
        - green
    httpHeader:
      x-name: httpHeader
      description: |
        A key/value map of a HTTP header
        ``` json
        {
          'Accept': 'application/json'
        }
        ```
      type: object
      properties:
        header:
          type: string
          xml:
            attribute: true
        value:
          type: string
          xml:
            attribute: true
    identities:
      description: Identities
      type: array
      minItems: 6
      maxItems: 6
      items:
        $ref: '#/components/schemas/identity'
      xml:
        wrapped: true
    identity:
      type: object
      description: Describes a single identity
      x-name: identity
      properties:
        active:
          description: enables the identity for registration
          type: boolean
          default: false
        username:
          description: The user part of a SIP URI to register the identity
          type: string
        password:
          description: The password to authenticate the identity register
          type: string
          format: password
        displayname:
          description: The display name of the identity
          type: string
        registrar:
          description: The SIP registrar hostname/address
          type: string
        registrarPort:
          description: The SIP registrar port
          type: integer
          format: int32
          minimum: 1
          maximum: 65535
          default: 5060
        realm:
          description: The domain of the identity (may differ from registrar)
          type: string
        localSipPort:
          description: outgoing port of SIP messages. 0 will be used for generating a random one.
          type: integer
          format: int32
          minimum: 0
          maximum: 65535
          default: 0
        sendRegister:
          description: If true a SIP REGISTER will be send
          type: boolean
          default: true
        registerInterval:
          description: Timeout of registration
          type: integer
          format: int32
          minimum: 1
          maximum: 60
          default: 30
        nat:
          $ref: '#/components/schemas/nat'
        outboundProxy:
          $ref: '#/components/schemas/outboundProxy'
        frameSize:
          description: 'rtp frame size in milliseconds (typically 10, 20 or 30 ms)'
          type: integer
          format: int32
          minimum: 10
          maximum: 30
          default: 20
        dialplan:
          $ref: '#/components/schemas/dialplan'
        useDialplanInCallLog:
          description: |
            Use the dialplan when starting a call from the CallLog.
          type: boolean
          default: false
        audiocodecs:
          $ref: '#/components/schemas/audiocodeclist'
        clir:
          default: displayAnonymous
          $ref: '#/components/schemas/clirType'
        vmb:
          description: The sip-username where the phone should subscribe to to get information about voice-messages. It is also used to make the call when trying to access these messages.
          type: string
        localmoh:
          description: plays local music on hold if a call of this identity is set on hold. When enabled, held calls will take away one audio-channel. Since our phones only have 2 channels, this will limit the number of simultaneous calls to two.
          type: boolean
          default: false
        secureConnection:
          description: |
            Activates sips (SIP over TLS) on connections with this identity. Most likely you have to provide a certificate for the host you provided to be able to connect safely and successfully.
          type: boolean
          default: false
        srtp:
          $ref: '#/components/schemas/srtpMode'
        checkHostname:
          description: |
            Validate the hostname against the CN of the provided Certificate.
          type: boolean
          default: true
        Peer2PeerTls:
          description: |
            SIPS scheme is used if activated. Means the whole SIP path must be encrypted by TLS
          type: boolean
          default: false
        certificate:
          description: |
            Root certificate used as a trust anchor for the host. Text in PEM format.
          $ref: '#/components/schemas/pemCert'
        pickupCode:
          description: used as pre code for the user part in an invite URI in case of a pickup szenario. e.g. '##06'
          type: string
          default: '##06'
        ipVersion:
          description: ip version (v4, v6 or automatic) for communication with the host
          $ref: '#/components/schemas/ipVersion'
        jitterBufferSize:
          description: |
            The size of the incoming rtp buffer in milliseconds. Should be greater than twice the frameSize. Lesser values reduce delays in the audio handling. A greater value allows a more robust communication when there are network issues.
          type: integer
          format: int32
          minimum: 40
          default: 60
          maximum: 160
        interfaceType:
          $ref: '#/components/schemas/networkInterface'
        authenticationUsername:
          description: optional authentication username used by some of the providers
          type: string
        protocolType:
          $ref: '#/components/schemas/networkProtocol'
          default: udp
        sessionTimerActive:
          description: use timeout for SIP sessions
          type: boolean
          default: true
        sessionTimerValue:
          description: timeout for SIP sessions in minutes
          type: integer
          format: int32
          minimum: 2
          default: 15
          maximum: 255
    networkInterface:
      x-name: networkInterface
      type: string
      default: network
      enum:
        - network
        - vpn
    networkProtocol:
      description: protocol used for network traffic
      x-name: networkProtocol
      type: string
      enum:
        - udp
        - tcp
    srtpMode:
      x-name: srtpMode
      type: string
      default: optional
      enum:
        - mandatory
        - optional
        - disabled
    ipVersion:
      x-name: ipVersion
      type: string
      default: IpAuto
      enum:
        - IpV4
        - IpV6
        - IpAuto
    nat:
      type: object
      x-name: nat
      xml:
        name: nat
      properties:
        useStunSip:
          $ref: '#/components/schemas/useStunSip'
        useStunRtp:
          $ref: '#/components/schemas/useStunRtp'
        stunUrl:
          type: string
        stunPort:
          type: integer
          format: int32
          minimum: 1
          default: 3478
          maximum: 65535
        stunRequestInterval:
          type: integer
          format: int32
          minimum: 1
          default: 5
          maximum: 60
        keepaliveInterval:
          type: integer
          format: int32
          minimum: 15
          default: 45
          maximum: 255
    useStunSip:
      type: string
      x-name: useStunSip
      default: inactive
      enum:
          - inactive
          - activeStun
          - active
    useStunRtp:
      type: string
      x-name: useStunRtp
      default: inactive
      enum:
          - inactive
          - activeStun
    outboundProxy:
      type: object
      x-name: outboundProxy
      xml:
        name: outboundProxy
      properties:
        mode:
          $ref: '#/components/schemas/outboundProxyMode'
        url:
          type: string
        port:
          type: integer
          format: int32
          minimum: 1
          maximum: 65535
        url2:
          type: string
        port2:
          type: integer
          format: int32
          minimum: 1
          maximum: 65535
    outboundProxyMode:
      type: string
      x-name: outboundProxyMode
      default: inactive
      enum:
        - inactive
        - automatic
        - manual
    dialplan:
      type: array
      minItems: 1
      items:
        $ref: '#/components/schemas/rule'
      xml:
        wrapped: true
    rule:
      type: object
      x-name: rule
      required:
       - pattern
       - replace
      properties:
        pattern:
          type: string
        replace:
          type: string
    audiocodeclist:
      type: array
      minItems: 1
      items:
        $ref: '#/components/schemas/audiocodec'
      xml:
        wrapped: true
    audiocodec:
      x-name: audiocodec
      type: string
      enum:
        - G.711
        - G.722
        - G.726
        - G.729
        - iLBC
    clirType:
      x-name: clirType
      description: >
          "When clir is enabled we set the X-Privacy-Header in outgoing calls. We also change the From-Header to either:"
          "- not include a display-name"
          "- say the display-name is 'anonymous'"
          "- have the username set to ananymous, i.e. anonymous@registrar"
      type: string
      default: displayEmpty
      enum:
        - displayEmpty
        - displayAnonymous
        - userAnonymous
    audioDevice:
      x-name: audioDevice
      type: string
      enum:
        - speaker
        - headset
    sound:
      type: object
      properties:
        defaultRingtone:
          description: which ringtone shall be used by default
          default: Office2
          $ref: '#/components/schemas/ringtone'
        defaultNotification:
          description: which notification shall be used by default
          default: Aldebaran
          $ref: '#/components/schemas/notification'
        defaultAlarm:
          description: which alarm shall be used by default
          default: Alarm_Beep_01
          $ref: '#/components/schemas/alarm'
        volumes:
          $ref: '#/components/schemas/volumes'
    volumes:
      type: object
      x-name: volumes
      properties:
        ringing:
          description: volume to use when phone is ringing
          type: integer
          format: int32
          minimum: 0
          maximum: 7
          default: 7
        notifying:
          description: volume to use when a notification becomes active
          type: integer
          format: int32
          minimum: 0
          maximum: 7
          default: 7
        alarming:
          description: volume to use when an alarm becomes active
          type: integer
          format: int32
          minimum: 0
          maximum: 7
          default: 7
        headset:
          description: volume-level used to play audio via headset
          type: integer
          format: int32
          minimum: 1
          maximum: 10
          default: 9
        speaker:
          description: volume-level used to play audio via speaker
          type: integer
          format: int32
          minimum: 1
          maximum: 10
          default: 9
        handset:
          description: volume-level used to play audio via handset
          type: integer
          format: int32
          minimum: 1
          maximum: 10
          default: 9
    ringtone:
      type: string
      x-name: ringtone
      x-no-enum: true
      enum:
        - 80s
        - American_Phone
        - Big_A
        - Classic1
        - Classic2
        - Classic3
        - CrazyDream
        - Door
        - DreamTheme
        - Groovy1
        - Groovy2
        - Groovy3
        - Jazz1
        - Jazz2
        - Leo
        - Office1
        - Office2
        - Office3
        - Office4
        - Old_Phone
        - Road_Trip
        - Special
        - Aldebaran
        - Talitha
        - Selenium
        - Alarm_Beep_01
        - Alarm_Beep_02
        - Scandium
    notification:
      type: string
      x-name: notification
      x-no-enum: true
      enum:
        - 80s
        - American_Phone
        - Big_A
        - Classic1
        - Classic2
        - Classic3
        - CrazyDream
        - Door
        - DreamTheme
        - Groovy1
        - Groovy2
        - Groovy3
        - Jazz1
        - Jazz2
        - Leo
        - Office1
        - Office2
        - Office3
        - Office4
        - Old_Phone
        - Road_Trip
        - Special
        - Aldebaran
        - Talitha
        - Selenium
        - Alarm_Beep_01
        - Alarm_Beep_02
        - Scandium
    alarm:
      type: string
      x-name: alarm
      x-no-enum: true
      enum:
        - 80s
        - American_Phone
        - Big_A
        - Classic1
        - Classic2
        - Classic3
        - CrazyDream
        - Door
        - DreamTheme
        - Groovy1
        - Groovy2
        - Groovy3
        - Jazz1
        - Jazz2
        - Leo
        - Office1
        - Office2
        - Office3
        - Office4
        - Old_Phone
        - Road_Trip
        - Special
        - Aldebaran
        - Talitha
        - Selenium
        - Alarm_Beep_01
        - Alarm_Beep_02
        - Scandium
    telephony:
      type: object
      properties:
        callWaiting:
          description: if and how a waiting call has to be signalised
          $ref: '#/components/schemas/callWaiting'
        doNotDisturb:
          description: if an incoming call shall be rejected
          $ref: '#/components/schemas/doNotDisturb'
        callForwarding:
          $ref: '#/components/schemas/callForwarding'
        clir:
          description: Tells the PBX to hide the callers identity in outgoing calls.
          $ref: '#/components/schemas/clir'
        reverseNumberLookup:
          description: When enabled looks for name of call-partner in adressbooks (local, ldap, ..).
          $ref: '#/components/schemas/reverseNumberLookup'
        defaultAudioDevice:
          description: default audio device in idle like headset or speaker
          default: speaker
          $ref: '#/components/schemas/audioDevice'
        activeLine:
          description: |
            line to use for unspecified outgoing calls. Uses the first defined line if not defined
          $ref: '#/components/schemas/line'
        callStartTimeout:
          type: integer
          format: int32
          description: |
            Time delay to start the call when there is no activity. Measured in milliseconds. -1 = never
          default: -1
        callAcceptTimeout:
          type: integer
          format: int32
          description: |
            Time delay to accept an incoming call automatically. Measured in milliseconds. -1 = never
          default: -1
          minimum: -1
          maximum: 60000
        callCompletion:
          description: "if an outgoing call isn't connected (busy 'CCBS', not responding 'CCNR')"
          $ref: '#/components/schemas/callCompletion'
    callCompletion:
      type: object
      x-name: callCompletion
      properties:
        active:
          description: enables the function callCompletion
          type: boolean
          default: false
        timeout:
          description: time to wait for 'not responding' in seconds
          type: integer
          format: int32
          default: -1
          minimum: -1
          maximum: 60
    callWaiting:
      type: object
      x-name: callWaiting
      properties:
        active:
          description: enables the function callWaiting
          type: boolean
          default: false
        tone:
          description: enables the signalisation of a waiting call
          type: boolean
          default: true
    doNotDisturb:
      type: object
      x-name: doNotDisturb
      properties:
        active:
          description: enables the function doNotDisturb
          type: boolean
          default: false
    callForwarding:
      type: object
      x-name: callForwarding
      properties:
        unconditional:
          $ref: '#/components/schemas/callForwardingMethod'
        busy:
          $ref: '#/components/schemas/callForwardingMethod'
        noResponse:
          $ref: '#/components/schemas/callForwardingMethod'
    callForwardingMethod:
      type: object
      x-name: callForwardingMethod
      required:
        - target
        - active
      properties:
        active:
          description: enables call forwarding
          type: boolean
          default: false
        target:
          description: the target to forward calls to
          $ref: '#/components/schemas/uri'
        timeout:
          description: the time [s] after which the call must be forwarded
          type: integer
          format: int32
          default: 20
    clir:
      type: object
      x-name: clir
      properties:
        active:
          description: Tells the PBX to hide the callers identity in outgoing calls.
          type: boolean
          default: false
    reverseNumberLookup:
      type: object
      x-name: reverseNumberLookup
      properties:
        active:
          description: When enabled looks for name of call-partner in adressbooks (local, ldap, ..).
          type: boolean
          default: true
    provisioning:
      type: object
      properties:
        active:
          description: enables the provisioning
          type: boolean
        dhcp:
          description: checks the dhcp fields 66 and 67 for an provisioning url
          type: boolean
        redirect:
          description: >-
            checks for a provisioning redirection on
            connect.redirect.auerswald.de
          type: boolean
        pbx:
          description: >-
            checks via properitary sip-multicast extension for an provisioning
            url
          type: boolean
        url:
          description: the url to use when nothing else is available
          $ref: '#/components/schemas/uri'
        sip:
          description: configuration via the established sip connection
          $ref: '#/components/schemas/sipProvisioning'
        execution:
          $ref: '#/components/schemas/executionTime'
    sipProvisioning:
      x-name: sipProvisioning
      type: object
      properties:
        active:
          description: allows provisioning via sip
          type: boolean
        whitelist:
          description: list of valid sender hosts
          $ref: '#/components/schemas/whitelist'
    whitelist:
      type: array
      minItems: 1
      items:
        $ref: '#/components/schemas/whitelistEntry'
      xml:
        wrapped: true
    whitelistEntry:
      type: string
      x-name: whitelistEntry
    executionTime:
      x-name: executionTime
      type: object
      description: defines when to execute a given task.
      properties:
        mondays:
          type: boolean
        tuesdays:
          type: boolean
        wednesdays:
          type: boolean
        thursdays:
          type: boolean
        fridays:
          type: boolean
        saturdays:
          type: boolean
        sundays:
          type: boolean
        time:
          description: 'a time in HH:MM format'
          type: string
          pattern: ^(2[0-3]|[0-1]?[0-9]):[0-5][0-9]$
    update:
      type: object
      properties:
        check:
          description: check for updates
          type: boolean
        autoInstall:
          description: automatically install updates if available
          type: boolean
        url:
          description: url for update server
          $ref: '#/components/schemas/uri'
        execution:
          $ref: '#/components/schemas/executionTime'
    network:
      type: object
      properties:
        ethernet:
          $ref: '#/components/schemas/ethernet'
        vpn:
          $ref: '#/components/schemas/vpn'
    vpn:
      x-name: vpn
      type: object
      required:
        - name
      properties:
        active:
          type: boolean
          default: false
        vpnType:
          $ref: '#/components/schemas/vpnType'
        name:
          description: unique identifier of the Profile
          type: string
        server:
          description: server address or resolvable name
          type: string
        username:
          description: username, used for xauth
          type: string
        password:
          description: pasword, used for xauth
          type: string
          format: password
        dnsServers:
          description: multiple entries are seperated by space
          type: string
        searchDomains:
          description: multiple entries are seperated by space
          type: string
        routes:
          description: multiple entries are seperated by space, format 10.1.0.0/16
          type: string
        ipsecIdentifier:
          type: string
        ipsecSecret:
          description: preshared key, used in XauthPSK
          type: string
        ipsecUserCert:
          $ref: '#/components/schemas/pemCert'
        ipsecUserPrivateKey:
          $ref: '#/components/schemas/pemRsaKey'
        ipsecCaCert:
          $ref: '#/components/schemas/pemCert'
        ipsecServerCert:
          $ref: '#/components/schemas/pemCert'
        openvpnConfig:
          description: file content of an openvpn config file
          type: string
    vpnType:
      x-name: vpnType
      type: string
      default: IpsecXauthPSK
      enum:
       - IpsecXauthPSK
       - IpsecXauthRSA
       - IpsecHybridRSA
       - OpenVPN
    pemCert:
      description: X509 certificate in PEM format
      x-name: pemCert
      type: string
    pemRsaKey:
      x-name: pemRsaKey
      description: RSA key in PEM format
      type: string
    ethernet:
      x-name: ethernet
      type: object
      properties:
        ipv4:
          $ref: '#/components/schemas/ipv4'
        ipv6:
          $ref: '#/components/schemas/ipv6'
        vlan:
          $ref: '#/components/schemas/vlan'
    vlan:
      x-name: vlan
      type: object
      required:
        - phoneMode
        - workstationMode
      properties:
        phoneActive:
          $ref: '#/components/schemas/vlanActive'
        phoneId:
          $ref: '#/components/schemas/vlanId'
        phonePriority:
          $ref: '#/components/schemas/vlanPriority'
        workstationActive:
          $ref: '#/components/schemas/vlanActive'
        workstationId:
          $ref: '#/components/schemas/vlanId'
        workstationPriority:
          $ref: '#/components/schemas/vlanPriority'
    vlanActive:
      x-name: vlanactive
      type: boolean
      default: false
    vlanId:
      x-name: vlanid
      type: integer
      format: int32
      minimum: 0
      maximum: 4095
    vlanPriority:
      x-name: vlanpriority
      type: integer
      format: int32
      minimum: 0
      maximum: 7
    ipv4mode:
      x-name: ipv4mode
      type: string
      default: dhcp
      enum:
        - dhcp
        - static
        - disable
    ipv4:
      x-name: ipv4
      type: object
      required:
        - mode
      properties:
        mode:
          $ref: '#/components/schemas/ipv4mode'
        address:
          $ref: '#/components/schemas/ipv4address'
        netmask:
          $ref: '#/components/schemas/ipv4netmask'
        gateway:
          $ref: '#/components/schemas/ipv4address'
        dns1:
          $ref: '#/components/schemas/ipv4dns'
        dns2:
          $ref: '#/components/schemas/ipv4dns'
    ipv6mode:
      x-name: ipv6mode
      type: string
      default: slaac
      enum:
        - dhcp
        - slaac
        - disable
    ipv6:
      x-name: ipv6
      type: object
      required:
        - mode
      properties:
        mode:
          $ref: '#/components/schemas/ipv6mode'
        dns1:
          $ref: '#/components/schemas/ipv6address'
        dns2:
          $ref: '#/components/schemas/ipv6address'
    ipv4address:
      type: string
      pattern: >-
        ^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$
    ipv4dns:
      type: string
      pattern: >-
       ^(([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])|(\s*))$
    ipv4netmask:
      type: string
      pattern: >-
        ^(([012]?\d|3[012])|(((0|128|192|24[08]|25[24])\.0\.0\.0)|(255\.(0|128|192|24[08]|25[24])\.0\.0)|(255\.255\.(0|128|192|24[08]|25[24])\.0)|(255\.255\.255\.(0|128|192|24[08]|25[245]))))$
    ipv6address:
      type: string
      pattern: >-
        ^(((([0-9a-fA-F]{1,4}:){7,7}([0-9a-fA-F]{1,4}))|(([0-9a-fA-F]{1,4}:){1,7})|(([0-9a-fA-F]{1,4}:){1,6}(:[0-9a-fA-F]{1,4}))|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|(([0-9a-fA-F]{1,4}:){1,1}(:[0-9a-fA-F]{1,4}){1,6})|(:((:[0-9a-fA-F]{1,4}){1,7})|:)){0,1})$
    templates:
      type: array
      minItems: 0
      items:
        $ref: '#/components/schemas/template'
      xml:
        wrapped: true
    template:
      type: object
      x-name: template
      x-id-attribute: name
      required:
       - keyConfiguration
       - name
      properties:
        name:
          type: string
          xml:
            attribute: true
          description: >
            Text identifying the Template. Has to be unique.
            Will be referenced in key structure to store which template was
            used.
            Free usable text or android resource tag
        prio:
          type: integer
          format: int32
          description: |
            sort with prio
          xml:
            attribute: true
        description:
          type: string
          xml:
            attribute: true
        icon:
          description: |
            The icon of the key, base64 encoded.
            The icon is scaled to fit the display container.
            If starting with @drawable/ a android resource is used
          type: string
          format: byte
          xml:
            attribute: true
        keyConfiguration:
          $ref: '#/components/schemas/keyConfiguration'
        parameters:
          type: array
          xml:
            wrapped: true
          items:
            $ref: '#/components/schemas/parameter'
    parameter:
      type: object
      xml:
        name: parameter
      x-name: parameter
      required:
       - path
      properties:
        path:
          description: |
            List of XPath elements within the key structure.
          type: array
          minItems: 1
          items:
            type: string
        name:
          type: string
          xml:
            attribute: true
        description:
          type: string
          xml:
            attribute: true
        optional:
          type: boolean
          xml:
            attribute: true
        choice:
          type: array
          minItems: 0
          items:
            type: string
        mode:
          $ref: '#/components/schemas/tmpParamModeEnum'
    tmpParamModeEnum:
      x-name: tmpParamModeEnum
      type: string
      enum:
        - overwrite
        - append
        - replace
    display:
      type: object
      properties:
        timeout:
          type: integer
          format: int32
          description: |
            Time till lockscreen appears on no activity. Measured in milliseconds. -1 = never
          default: -1
        contrast:
          type: integer
          format: int32
          minimum: 1
          maximum: 7
        brightness:
          type: integer
          format: int32
          minimum: 1
          maximum: 7
    userInterface:
      type: object
      properties:
        display:
          $ref: '#/components/schemas/display'
        messages:
          $ref: '#/components/schemas/messages'
    messages:
      type: object
      x-name: messages
      x-JMembersHbGenerated: true
      properties:
        signalSeenMissedCalls:
          description: |
            Message appears when the missed call log has entries, none of which are new to the user.
          default: silent
          $ref: '#/components/schemas/msgSignalisation'
        signalOldMailboxMessages:
          description: |
            Message appears when the mailbox has entries, none of which are new to the user.
          default: silent
          $ref: '#/components/schemas/msgSignalisation'
    msgSignalisation:
      x-name: msgSignalisation
      type: string
      description: >-
            How to signal a message of a certain type.
            "off = Message never ever appears in message-screen, thus also doesn't affect the message-LED-behaviour"
            "silent = Message gets listed in message-screen, but doesn't affect the message-LED-behaviour"
            blink = Message gets listed in message-screen. It will cause the Message-LED to blink.
            on = Message gets listed in message-screen. It will cause the Message-LED to turn on, unless there is another message that overrides this with blinking.
      enum:
       - off
       - silent
       - blink
       - on
    remoteAccess:
      type: object
      properties:
        webd:
          description: enable remote access via http(s)
          type: boolean
          default: false
        adbd:
          description: enable remote access via adb
          type: boolean
          default: false
    apps:
      type: object
      description: Configuration of pre-installed apps and store.
      properties:
        allow_install:
          description: Enables installation of additional apps.
          type: boolean
          default: false
        store_enabled:
          description: Enables access to pre-installed store 'F-Droid'.
          type: boolean
          default: true
        browser_enabled:
          description: Enables access to pre-installed browser 'Firefox Klar'.
          type: boolean
          default: true
        mail_enabled:
          description: Enables access to pre-installed mail-app 'K-9 Mail'.
          type: boolean
          default: true
    timeAndDate:
       type: object
       properties:
         ntpEnable:
           type: boolean
         ntpServer:
           $ref: '#/components/schemas/uri'
         timezone:
           $ref: '#/components/schemas/timezone'
         timeHourFormat:
           $ref: '#/components/schemas/timeHourFormat'
    locales:
      type: object
      properties:
        deviceLanguage:
          $ref: '#/components/schemas/language'
        webserverLanguage:
          $ref: '#/components/schemas/language'
        deviceLocation:
          $ref: '#/components/schemas/locale'
    locale:
      x-name: locale
      type: string
      enum:
       - de_DE
       - de_AT
       - de_CH
       - de_BE
       - en_GB
       - fr_FR
       - fr_CH
       - fr_BE
       - el_GR
       - pl_PL
       - es_ES
       - nl_NL
       - nl_BE
       - it_IT
       - it_CH
    language:
      x-name: language
      type: string
      enum:
       - de_DE
       - en_GB
       - fr_FR
       - el_GR
       - pl_PL
       - es_ES
       - nl_NL
       - it_IT
    timeHourFormat:
      type: string
      default: clock24hours
      enum:
        - clock12hours
        - clock24hours
    timezone:
      description: |
        time zone description in olsen names. Supports correct handling for summer/winter times
      type: string
      x-no-enum: true
      enum:
       - Pacific/Midway
       - Pacific/Honolulu
       - America/Anchorage
       - America/Los_Angeles
       - America/Tijuana
       - America/Phoenix
       - America/Chihuahua
       - America/Denver
       - America/Costa_Rica
       - America/Chicago
       - America/Mexico_City
       - America/Regina
       - America/Bogota
       - America/New_York
       - America/Caracas
       - America/Barbados
       - America/Halifax
       - America/Manaus
       - America/Santiago
       - America/St_Johns
       - America/Recife
       - America/Sao_Paulo
       - America/Buenos_Aires
       - America/Godthab
       - America/Montevideo
       - Atlantic/South_Georgia
       - Atlantic/Azores
       - Atlantic/Cape_Verde
       - Africa/Casablanca
       - Europe/London
       - Europe/Amsterdam
       - Europe/Belgrade
       - Europe/Berlin
       - Europe/Brussels
       - Europe/Madrid
       - Europe/Sarajevo
       - Africa/Windhoek
       - Africa/Brazzaville
       - Asia/Amman
       - Europe/Athens
       - Europe/Istanbul
       - Asia/Beirut
       - Africa/Cairo
       - Europe/Helsinki
       - Asia/Jerusalem
       - Europe/Minsk
       - Africa/Harare
       - Asia/Baghdad
       - Europe/Moscow
       - Asia/Kuwait
       - Africa/Nairobi
       - Asia/Tehran
       - Asia/Baku
       - Asia/Tbilisi
       - Asia/Yerevan
       - Asia/Dubai
       - Asia/Kabul
       - Asia/Karachi
       - Asia/Oral
       - Asia/Yekaterinburg
       - Asia/Calcutta
       - Asia/Colombo
       - Asia/Katmandu
       - Asia/Almaty
       - Asia/Rangoon
       - Asia/Krasnoyarsk
       - Asia/Bangkok
       - Asia/Jakarta
       - Asia/Shanghai
       - Asia/Hong_Kong
       - Asia/Irkutsk
       - Asia/Kuala_Lumpur
       - Australia/Perth
       - Asia/Taipei
       - Asia/Seoul
       - Asia/Tokyo
       - Asia/Yakutsk
       - Australia/Adelaide
       - Australia/Darwin
       - Australia/Brisbane
       - Australia/Hobart
       - Australia/Sydney
       - Asia/Vladivostok
       - Pacific/Guam
       - Asia/Magadan
       - Pacific/Noumea
       - Pacific/Majuro
       - Pacific/Auckland
       - Pacific/Fiji
       - Pacific/Tongatapu
    logging:
        type: object
        properties:
            remotes:
                type: array
                minItems: 0
                xml:
                    wrapped: true
                items:
                    $ref: '#/components/schemas/remoteLog'
    remoteLog:
        x-name: remoteLog
        type: object
        required:
            - server
            - port
            - protocol
        properties:
            server:
                $ref: '#/components/schemas/hostname'
            port:
                $ref: '#/components/schemas/port'
            protocol:
                $ref: '#/components/schemas/logProtocol'
            filter:
                $ref: '#/components/schemas/logcatFilter'
    logProtocol:
        description: "Protocol to use for logging"
        x-name: logProtocol
        type: string
        enum:
          - udp
    hostname:
        description: "Hostname of the log server"
        type: string
        minLength: 1
    port:
        description: "Port of the log server"
        type: integer
        format: int32
        minimum: 1
        maximum: 65535
    logcatFilter:
        description: >-
            Filter to use for logging. A space-separated list of TAG[:Priority].
            TAG can be "*" for all, Priority can be one of
            S:silent E:error W:warning I:info D:debug V:verbose.
            Default priority if omitted is [V]erbose.
        type: string
        pattern: >-
            ^[\S]+(:[SEWIDV])?( [\S]+(:[SEWIDV])?)*$
    luaLibraries:
        type: array
        items:
            $ref: '#/components/schemas/luaLibrary'
        xml:
            wrapped:
                true
    luaLibrary:
        x-name: luaLibrary
        x-id-attribute: name
        xml:
            name:
                luaLibrary
        type: object
        properties:
            name:
              type: string
              xml:
                  attribute:
                      true
            code:
                $ref: '#/components/schemas/luaCode'
