Register a new user in DD
---
# NotaBLE és la col·laboració entre Gwido i el Workspace educatiu DD.
#
# És un projecte de Xnet, IsardVDI, Gwido i Taller de Músics,
# guanyador de la Ciutat Proactiva 2021, suport a la innovació urbana de
# la Fundació BitHabitat.

definitions:
  KeycloakId:
    type: object
    properties:
      keycloak_id:
        required: True
        type: string
consumes:
  - application/json
parameters:
  - in: body
    name: user
    description: |
      The user to be registered on DD.
    schema:
      type: object
      properties:
        username:
          required: True
          type: string
        first:
          required: True
          type: string
        last:
          required: True
          type: string
        email:
          required: True
          type: string
          format: email
        password:
          required: True
          type: string
          format: email
        password_temporary:
          required: False
          type: bool
        quota:
          required: True
          type: string
        enabled:
          required: True
          type: bool
        role:
          required: True
        groups:
          required: True
          type: array
          items:
            type: string
responses:
  200:
      description: |
        The keycloak_id of the newly registered user
      schema:
        $ref: '#/definitions/KeycloakId'
      examples: |
        { "keycloak_id": "f6ec2bda-bec9-415f-bcb7-f5ae644bfec5" }
  409:
      description: |
        The user already exists
