openapi: 3.0.1
info:
  title: Datalogic Connect
  version: 0.11.1
servers:
  - url: /
    description: Local server
  - url: >-
      https://ca-rm-infra-backend-dev-euw.gentlesmoke-7f7761b4.westeurope.azurecontainerapps.io
    description: Azure server
tags:
  - name: Organizations
    description: Organizations is a service that makes it easy to manage your organizations
  - name: Licenses
    description: Licenses is a service that makes it easy to manage your licenses
  - name: Locations
    description: Locations is a service that makes it easy to manage your locations
  - name: Device Templates
    description: Device Templates API
  - name: Device Actions
    description: Device Actions API
  - name: Device Groups
    description: >-
      Device Groups is a service that makes it easy to manage your groups of
      devices.
  - name: Users
    description: Users is a service that makes it easy to manage your users
  - name: Devices
    description: Devices is a service that makes it easy to manage your devices
  - name: Device Categories
    description: Device Categories API
  - name: Storage
    description: Storage is a service that makes it easy to manage files on Azure storage
  - name: Misc
    description: Misc APIs
  - name: Rma
    description: Rma API
paths:
  /api/me:
    get:
      tags:
        - Misc
      summary: get the user information, including the organization and roles
      description: >-
        This endpoint retrieves the user information, including the organization
        and roles.
      operationId: getUserInfo
      responses:
        '200':
          description: The user information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithOrgsResponse'
        '400':
          description: The user needs to provide a valid user ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You do not have the necessary permissions to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Misc
      summary: update the user information
      description: This endpoint update the user information.
      operationId: updateUserInfo
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateMeRequest'
        required: true
      responses:
        '200':
          description: The user information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithOrgsResponse'
        '400':
          description: The user needs to provide a valid user ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You do not have the necessary permissions to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/me/longOperation/{duration}:
    get:
      tags:
        - Misc
      operationId: longOperation
      parameters:
        - name: duration
          in: path
          description: Duration in ms
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: longOperation 200 response
          content:
            application/json:
              schema:
                type: string
      security:
        - bearerAuth: []
  /api/{organizationId}:
    get:
      tags:
        - Organizations
      operationId: getOrganization
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: getOrganization 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationResponse'
      security:
        - bearerAuth: []
  /api/{organizationId}/actions:
    get:
      tags:
        - Device Actions
      summary: Get device Actions
      description: Get device Actions for an organization
      operationId: getDeviceActions
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: locationId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: id
          in: query
          schema:
            type: string
            format: uuid
            nullable: true
        - name: name
          in: query
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: Device Actions for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_ActionResponse_'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    post:
      tags:
        - Device Actions
      summary: Create device Action
      description: Create a device Action for an organization
      operationId: createDeviceAction
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionRequest'
        required: true
      responses:
        '200':
          description: Action created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/actions/{actionId}:
    get:
      tags:
        - Device Actions
      summary: Get device Action
      description: Get a device Action for an organization
      operationId: getDeviceAction
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: actionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Device Action for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Action not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/actions/{actionId}/commands:
    get:
      tags:
        - Device Actions
      summary: Get device Action commands
      description: Get all commands related to a device Action for an organization
      operationId: getDeviceActionCommands
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: actionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Device Action commands for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_CommandDetails_'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Action not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/artifacts:
    get:
      tags:
        - Storage
      summary: Get files
      description: >-
        This API allow you to retrieve all the filtered files if you are allowed
        to see.
      operationId: searchByFilters
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: name
          in: query
          schema:
            type: string
            nullable: true
        - name: id
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
        - name: description
          in: query
          schema:
            type: string
            nullable: true
        - name: filePath
          in: query
          schema:
            type: string
            nullable: true
        - name: dataType
          in: query
          schema:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/DeviceConfigType'
        - name: owner
          in: query
          schema:
            type: string
            nullable: true
        - name: categoryIds
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: integer
              format: int64
        - name: sizeStart
          in: query
          schema:
            type: integer
            format: int64
            nullable: true
        - name: sizeEnd
          in: query
          schema:
            type: integer
            format: int64
            nullable: true
        - name: createdAtStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: createdAtEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: updatedAtStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: updatedAtEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
      responses:
        '200':
          description: The files have been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_FileRecord.FileRecordResponse_'
        '400':
          description: Tags do not have correct json format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/artifacts/types:
    get:
      tags:
        - Storage
      summary: Get file types
      description: This API allow you to retrieve a file types if you are allowed to see.
      operationId: getFileTypes
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The file types has been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileTypesResponse'
        '404':
          description: File types not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/artifacts/upload:
    post:
      tags:
        - Storage
      summary: Upload a file
      description: This API can be used to upload a file on Azure.
      operationId: uploadFile
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                id:
                  type: string
                  nullable: true
                name:
                  type: string
                  nullable: true
                description:
                  type: string
                  nullable: true
                categoryId:
                  type: integer
                  format: int64
                  nullable: true
                file:
                  type: string
                  format: binary
            encoding:
              file:
                contentType: application/octet-stream
              name:
                contentType: application/octet-stream
              description:
                contentType: application/octet-stream
              id:
                contentType: application/octet-stream
              categoryId:
                contentType: application/octet-stream
        required: true
      responses:
        '200':
          description: The file has been uploaded successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileRecord.FileRecordResponse'
        '413':
          description: File too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: File already present or error during communication with Azure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/artifacts/{id}:
    get:
      tags:
        - Storage
      summary: Get file
      description: This API allow you to retrieve a file if you are allowed to see.
      operationId: getFile
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The file has been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileRecord.FileRecordResponse'
        '404':
          description: File not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Storage
      summary: Update file
      description: This API allow you to update a file if you are allowed.
      operationId: updateFile
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFileDTO'
        required: true
      responses:
        '200':
          description: The file has been updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileRecord.FileRecordResponse'
        '404':
          description: File not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Storage
      summary: Delete file
      description: This API allow you to delete one file if you have the permission.
      operationId: removeFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: removeFile 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '204':
          description: The file has been deleted successfully.
        '403':
          description: Not authorised to upload files to the blob storage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: File not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Error during communication with Azure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/artifacts/{id}/download:
    get:
      tags:
        - Storage
      summary: Get download link for file
      description: >-
        This API allow you to retrieve a download link for file if you are
        allowed to see.
      operationId: getDownloadLink
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: expirationMinutes
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: The download link has been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileLinkResponse'
        '404':
          description: File not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/counters:
    get:
      tags:
        - Organizations
      summary: Get Organization Counters
      description: Get counters for an organization
      operationId: getCounters
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      responses:
        '200':
          description: Counters for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationCounterResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/device-groups:
    get:
      tags:
        - Device Groups
      summary: Get all device groups
      description: This API can be used to retrieve all device groups.
      operationId: getDeviceGroups
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: id,desc
        - name: ids
          in: query
          description: Optional filter by device group ID.
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: name
          in: query
          description: Optional filter by device group name.
          schema:
            type: string
            nullable: true
        - name: description
          in: query
          schema:
            type: string
            nullable: true
        - name: locationIds
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
      responses:
        '200':
          description: List of device groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DeviceGroupResponse_'
        '401':
          description: You don't have access to device groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    post:
      tags:
        - Device Groups
      summary: Create device group
      description: |-

        <p>This API can be used to create a new device group.</p>

        <h3>Required fields</h3>
        <ul>
            <li><b>locationId</b></li>
            <li><b>categoryId</b></li>
        </ul>

        <h3>Available Fields and Operators in <code>query</code> parameter</h3>

        <h4>deviceId</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>deviceName</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>parentName</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>locationId</h4>
        <ul>
            <li><b>Type:</b> Array of UUIDs</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>

        <h4>categoryId</h4>
        <ul>
            <li><b>Type:</b> Array of integers</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>

        <h4>deviceType</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> iotEdge, iotDevice, host</li>
        </ul>

        <h4>creationDate</h4>
        <ul>
            <li><b>Type:</b> Array of dates <code>[from, to]</code> (ISO 8601 format)</li>
            <li><b>Operators:</b> BETWEEN</li>
            <li><b>Note:</b> You can specify only one date (from or to) by setting the other to null. If only one date is provided, it will be considered as the "from" date.</li>
        </ul>

        <h4>connection</h4>
        <ul>
            <li><b>Type:</b> Boolean</li>
            <li><b>Operators:</b> EQUALS</li>
        </ul>

        <h4>status</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> WAITING_FOR_APPROVAL, REGISTERED, BLOCKED, PROVISIONED</li>
        </ul>
            
      operationId: createDeviceGroup
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        description: The request body containing name, description, and query filters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceGroupRequest'
            examples:
              Basic Example:
                summary: Simple device group with location and type filters
                value:
                  name: IoT Devices in Location A
                  description: All IoT devices in location A
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: locationId
                      operator: IN
                      value:
                        - 54519926-4bf6-b691-86af-5e7173cde7e6
                    - field: deviceType
                      operator: IN
                      value:
                        - iotDevice
              Advanced Example:
                summary: Complex query with multiple filters
                value:
                  name: Advanced Filter Group
                  description: Devices with complex filtering
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: deviceId
                      operator: STARTS_WITH
                      value:
                        - DEV
                    - field: deviceName
                      operator: CONTAINS
                      value:
                        - sensor
                    - field: locationId
                      operator: IN
                      value:
                        - 54519926-4bf6-b691-86af-5e7173cde7e6
                    - field: categoryId
                      operator: NOT_IN
                      value:
                        - 85
                        - 189
                    - field: deviceType
                      operator: IN
                      value:
                        - iotDevice
                        - iotEdge
                    - field: creationDate
                      operator: BETWEEN
                      value:
                        - '2023-01-01'
                        - '2023-12-31'
                    - field: connection
                      operator: EQUALS
                      value: true
                    - field: status
                      operator: IN
                      value:
                        - registered
                        - provisioned
                    - field: parentName
                      operator: EQUALS
                      value:
                        - Gateway1
              Date Range - From Only:
                summary: Filter devices created after a specific date
                value:
                  name: Recent Devices
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: creationDate
                      operator: BETWEEN
                      value:
                        - '2024-01-01'
                        - null
              Disconnected Devices:
                summary: Find all disconnected devices
                value:
                  name: Offline Devices
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: connection
                      operator: EQUALS
                      value: false
        required: true
      responses:
        '200':
          description: The created device group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceGroupResponse'
        '201':
          description: Device group created successfully
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have permission to create a device group
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: Conflict during creation of device group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/device-groups/preview:
    post:
      tags:
        - Device Groups
      summary: Preview devices matching filters
      description: >-

        <p>This API can be used to preview which devices would be part of a
        device group based on filters.</p>


        <h3>Required fields</h3>

        <ul>
            <li><b>locationId</b></li>
            <li><b>categoryId</b></li>
        </ul>


        <h3>Available Fields and Operators in <code>query</code> parameter</h3>


        <h4>deviceId</h4>

        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>


        <h4>deviceName</h4>

        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>


        <h4>parentName</h4>

        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>


        <h4>locationId</h4>

        <ul>
            <li><b>Type:</b> Array of UUIDs</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>


        <h4>categoryId</h4>

        <ul>
            <li><b>Type:</b> Array of integers</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>


        <h4>deviceType</h4>

        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> iotEdge, iotDevice, host</li>
        </ul>


        <h4>creationDate</h4>

        <ul>
            <li><b>Type:</b> Array of dates <code>[from, to]</code> (ISO 8601 format)</li>
            <li><b>Operators:</b> BETWEEN</li>
            <li><b>Note:</b> You can specify only one date (from or to) by setting the other to null. If only one date is provided, it will be considered as the "from" date.</li>
        </ul>


        <h4>connection</h4>

        <ul>
            <li><b>Type:</b> Boolean</li>
            <li><b>Operators:</b> EQUALS</li>
        </ul>


        <h4>status</h4>

        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> WAITING_FOR_APPROVAL, REGISTERED, BLOCKED, PROVISIONED</li>
        </ul>
            
      operationId: previewDevices
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: id,desc
        - name: id
          in: query
          schema:
            type: string
            nullable: true
        - name: name
          in: query
          schema:
            type: string
            nullable: true
      requestBody:
        description: The list of filters to apply.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceGroupFilterRequest'
            examples:
              example:
                value:
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: locationId
                      operator: IN
                      value:
                        - id1
                        - id2
                        - id3
                    - field: categoryId
                      operator: NOT_IN
                      value:
                        - 85
                        - 189
                        - 190
                    - field: creationDate
                      operator: BETWEEN
                      value:
                        - '2023-01-01'
                        - '2023-12-31'
                    - field: deviceId
                      operator: CONTAINS
                      value:
                        - id1
                        - id2
                        - id3
                    - field: deviceName
                      operator: EQUALS
                      value:
                        - device1
                        - device2
                    - field: deviceType
                      operator: NOT_IN
                      value:
                        - type1
                        - type2
                    - field: connection
                      operator: EQUALS
                      value: false
                    - field: status
                      operator: IN
                      value:
                        - status1
                        - status2
                    - field: parentName
                      operator: NOT_EQUALS
                      value:
                        - parent1
                        - parent2
        required: true
      responses:
        '200':
          description: List of matching devices
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DeviceResponse_'
        '400':
          description: Invalid filters format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/device-groups/{deviceGroupId}:
    get:
      tags:
        - Device Groups
      summary: Get device group by ID
      description: Returns a specific device group by its ID.
      operationId: getDeviceGroup
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceGroupId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Device group details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceGroupResponse'
        '404':
          description: Device group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Device Groups
      summary: Update device group
      description: |-

        <p>This API can be used to update an existing device group.</p>

        <h3>Available Fields and Operators in <code>query</code> parameter</h3>

        <h4>deviceId</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>deviceName</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>parentName</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> EQUALS, NOT_EQUALS, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS</li>
        </ul>

        <h4>locationId</h4>
        <ul>
            <li><b>Type:</b> Array of UUIDs</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>

        <h4>categoryId</h4>
        <ul>
            <li><b>Type:</b> Array of integers</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
        </ul>

        <h4>deviceType</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> iotEdge, iotDevice, host</li>
        </ul>

        <h4>creationDate</h4>
        <ul>
            <li><b>Type:</b> Array of dates <code>[from, to]</code> (ISO 8601 format)</li>
            <li><b>Operators:</b> BETWEEN</li>
            <li><b>Note:</b> You can specify only one date (from or to) by setting the other to null. If only one date is provided, it will be considered as the "from" date.</li>
        </ul>

        <h4>connection</h4>
        <ul>
            <li><b>Type:</b> Boolean</li>
            <li><b>Operators:</b> EQUALS</li>
        </ul>

        <h4>status</h4>
        <ul>
            <li><b>Type:</b> Array of strings</li>
            <li><b>Operators:</b> IN, NOT_IN</li>
            <li><b>Valid values:</b> WAITING_FOR_APPROVAL, REGISTERED, BLOCKED, PROVISIONED</li>
        </ul>
            
      operationId: updateDeviceGroup
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceGroupId
          in: path
          description: The ID of the device group to update.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: The request body with the fields to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceGroupUpdateRequest'
            examples:
              example:
                value:
                  name: Group A
                  description: Device group for location X
                  locationId: 54519926-4bf6-b691-86af-5e7173cde7e6
                  categoryId: 192
                  query:
                    - field: locationId
                      operator: IN
                      value:
                        - id1
                        - id2
                        - id3
                    - field: categoryId
                      operator: NOT_IN
                      value:
                        - 85
                        - 189
                        - 190
                    - field: creationDate
                      operator: BETWEEN
                      value:
                        - '2023-01-01'
                        - '2023-12-31'
                    - field: deviceId
                      operator: CONTAINS
                      value:
                        - id1
                        - id2
                        - id3
                    - field: deviceName
                      operator: EQUALS
                      value:
                        - device1
                        - device2
                    - field: deviceType
                      operator: NOT_IN
                      value:
                        - type1
                        - type2
                    - field: connection
                      operator: EQUALS
                      value: false
                    - field: status
                      operator: IN
                      value:
                        - status1
                        - status2
                    - field: parentName
                      operator: NOT_EQUALS
                      value:
                        - parent1
                        - parent2
        required: true
      responses:
        '200':
          description: Device group updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceGroupResponse'
        '400':
          description: User needs to provide a valid device group id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have permission to update a device group
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Device group not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: Conflict during updating of device group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Device Groups
      summary: Delete device group
      description: This API can be used to delete a device group by ID.
      operationId: deleteDeviceGroup
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceGroupId
          in: path
          description: The ID of the device group to delete.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: HTTP 204 No Content if deletion is successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '204':
          description: Device group deleted successfully.
        '404':
          description: Device group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/device-groups/{deviceGroupId}/details:
    get:
      tags:
        - Device Groups
      summary: Get device group detail
      description: >-
        Returns the list of devices that belong to the group based on the stored
        query.
      operationId: getDeviceGroupDetails
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: id,desc
        - name: deviceGroupId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Device group detail with devices
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DeviceResponse_'
        '404':
          description: Device group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/deviceCategories:
    get:
      tags:
        - Device Categories
      summary: Get device Categories
      description: Get device Categories for an organization
      operationId: getDeviceCategories
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      responses:
        '200':
          description: Device Categories for the organization
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceCategoryResponse'
        '401':
          description: Unauthorized
        '404':
          description: Organization not found
      security:
        - bearerAuth: []
  /api/{organizationId}/deviceCategories/visibility-widget:
    get:
      tags:
        - Device Categories
      summary: Get total and online devices by category
      description: Get total and online devices by category for an organization
      operationId: getTotalAndOnlineDevicesByCategory
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      responses:
        '200':
          description: Total and online devices by category for the organization
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CategoryDeviceCount'
        '401':
          description: Unauthorized
        '404':
          description: Organization not found
      security:
        - bearerAuth: []
  /api/{organizationId}/deviceCategories/{categoryId}:
    get:
      tags:
        - Device Categories
      summary: Get device category
      description: Get a device category for an organization
      operationId: getDevicecategory
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: categoryId
          in: path
          description: The category identifier
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Device category for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCategoryResponse'
        '401':
          description: Unauthorized
        '404':
          description: Device category not found
      security:
        - bearerAuth: []
  /api/{organizationId}/deviceTemplates:
    get:
      tags:
        - Device Templates
      summary: Get device Templates
      description: Get device Templates for an organization
      operationId: getDeviceTemplates
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      responses:
        '200':
          description: Device Templates for the organization
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceTemplateResponse'
        '401':
          description: Unauthorized
        '404':
          description: Organization not found
      security:
        - bearerAuth: []
  /api/{organizationId}/deviceTemplates/{templateId}:
    get:
      tags:
        - Device Templates
      summary: Get device template
      description: Get a device template for an organization
      operationId: getDeviceTemplate
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: templateId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Device template for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTemplateResponse'
        '401':
          description: Unauthorized
        '404':
          description: Device template not found
      security:
        - bearerAuth: []
  /api/{organizationId}/devices:
    get:
      tags:
        - Devices
      summary: Get devices
      description: This API allow you to retrieve all the devices you are allowed to see.
      operationId: getDevices
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: id
          in: query
          schema:
            type: string
            nullable: true
        - name: name
          in: query
          schema:
            type: string
            nullable: true
        - name: locationId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: deviceType
          in: query
          schema:
            nullable: true
            allOf:
              - $ref: '#/components/schemas/DeviceType'
        - name: deviceCategoryId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: integer
              format: int64
        - name: connection
          in: query
          schema:
            type: boolean
            nullable: true
        - name: status
          in: query
          schema:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/DeviceStatus'
        - name: parentIds
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
        - name: parentName
          in: query
          schema:
            type: string
            nullable: true
        - name: licenseProductType
          in: query
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: The devices have been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DeviceResponse_'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the devices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Devices
      summary: Update device
      description: This API can be used to add one device.
      operationId: updateDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceUpdateRequest'
        required: true
      responses:
        '200':
          description: The device has been added successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceResponse'
        '400':
          description: >-
            The user needs to provide a device id. If the device already exists,
            the user needs to provide a valid location id and a valid template
            id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to add the device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    post:
      tags:
        - Devices
      summary: Add device
      description: This API can be used to update one device.
      operationId: addDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceAddRequest'
        required: true
      responses:
        '200':
          description: The device has been updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceResponse'
        '400':
          description: >-
            The user needs to provide a device id. If the device does not exist,
            the user needs to provide a valid location id and a valid template
            id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to update the device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Devices
      summary: Delete devices
      description: This API allow you to delete devices if you have the permission.
      operationId: deleteDevices
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevicesDeleteRequest'
        required: true
      responses:
        '200':
          description: deleteDevices 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevicesDeleteResponse'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}:
    get:
      tags:
        - Devices
      summary: Get device
      description: This API allow you to retrieve a devices you are allowed to see.
      operationId: getDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The device has been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The device does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Devices
      summary: Delete device
      description: This API allow you to delete one device if you have the permission.
      operationId: deleteDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: deleteDevice 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '204':
          description: The device has been deleted successfully.
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to delete the device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The device does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/children:
    get:
      tags:
        - Devices
      summary: Get device's children
      description: >-
        This API allow you to retrieve all the device's children you are allowed
        to see.
      operationId: getDeviceChildren
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: id
          in: query
          schema:
            type: string
            nullable: true
        - name: name
          in: query
          schema:
            type: string
            nullable: true
        - name: locationId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: deviceType
          in: query
          schema:
            nullable: true
            allOf:
              - $ref: '#/components/schemas/DeviceType'
        - name: deviceCategoryId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: integer
              format: int64
        - name: connection
          in: query
          schema:
            type: boolean
            nullable: true
        - name: status
          in: query
          schema:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/DeviceStatus'
      responses:
        '200':
          description: The devices have been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_DeviceResponse_'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the devices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/commands:
    get:
      tags:
        - Devices
      summary: Get commands
      description: This API allow you to retrieve all the commands you are allowed to see.
      operationId: getCommands
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: createdAt,desc
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: status
          in: query
          schema:
            nullable: true
            allOf:
              - $ref: '#/components/schemas/CommandStatus'
        - name: commandName
          in: query
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: The commands have been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_CommandResponse_'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the commands.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/commands/{commandId}:
    get:
      tags:
        - Devices
      summary: Get command
      description: This API allow you to retrieve one command you are allowed to see.
      operationId: getCommand
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: commandId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The command has been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the command.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The command does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/commands/{commandName}:
    post:
      tags:
        - Devices
      summary: Execute command
      description: >-
        This API allow you to execute one command on one device (some fields can
        be null).
      operationId: executeCommands
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: commandName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommandRequestPayload'
            examples:
              Command with String payload:
                value:
                  payload: Any string payload
              Command with JSON payload:
                value:
                  payload:
                    key1: value1
                    key2: 2
                    key3: true
              Command with Attachment payload:
                value:
                  payload:
                    key1: value1
                    key2: 2
                    key3: true
                  files:
                    - 3fa85f64-5717-4562-b3fc-2c963f66afa6
        required: true
      responses:
        '200':
          description: The command has been executed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to execute the command.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/credentials:
    get:
      tags:
        - Devices
      summary: Credentials
      description: This API allows you to get all the credentials of a device.
      operationId: getDeviceCredentials
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The credentials have been retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCredentials'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The device does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/properties:
    get:
      tags:
        - Devices
      summary: Properties
      description: This API allows you to get all the properties of a device.
      operationId: getDeviceProperties
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The properties have been retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the properties.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The device does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/devices/{deviceId}/telemetries:
    get:
      tags:
        - Devices
      summary: Telemetry names
      description: This API allows you to get all the telemetry names of a device.
      operationId: getDeviceTelemetry
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The telemetry names have been retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to see the telemetry names.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The device does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/licenses:
    get:
      tags:
        - Licenses
      summary: Get all licenses
      description: >-
        This API can be used to retrieve all licenses for the specified
        organization
      operationId: listLicenses
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: created,desc
        - name: ids
          in: query
          description: Optional list of license UUIDs to filter.
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: name
          in: query
          description: Optional license name to filter.
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: List of licenses retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_License_'
        '401':
          description: You don't have access to licenses
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/licenses/{licenseKey}:
    get:
      tags:
        - Licenses
      summary: Get a license
      description: This API can be used to retrieve a specific license by its key.
      operationId: getLicense
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: licenseKey
          in: path
          description: The key of the license.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: License retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/License'
        '404':
          description: License not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/licenses/{licenseKey}/devices/{deviceId}:
    post:
      tags:
        - Licenses
      summary: Assign a license to a device
      description: This API can be used to assign a license to a device.
      operationId: assignLicenseToDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: licenseKey
          in: path
          description: The key of the license.
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          description: The ID of the device.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The assigned device DTO.
          content:
            application/json:
              schema:
                type: object
        '201':
          description: License assigned successfully
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: License or device not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Licenses
      summary: Deactivate a license from a device
      description: This API can be used to deactivate a license from a device.
      operationId: deactivateLicenseFromDevice
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: licenseKey
          in: path
          description: The key of the license.
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          description: The ID of the device.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: No content response.
          content:
            application/json:
              schema:
                type: object
        '204':
          description: License deactivated successfully
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: License or device not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/locations:
    get:
      tags:
        - Locations
      summary: Get all locations
      description: This API can be used to get all locations that you can view.
      operationId: getLocations
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: id,desc
      responses:
        '200':
          description: List of locations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_LocationResponse_'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to locations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Locations
      summary: Save location
      description: This API can be used to update an location.
      operationId: updateLocation
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationUpdateRequest'
        required: true
      responses:
        '200':
          description: Location saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '400':
          description: >-
            User needs to provide a valid organization id. If the location is
            new the id should be null
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have permission to update location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    post:
      tags:
        - Locations
      summary: Create location
      description: This API can be used to create a new location.
      operationId: createLocation
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationAddRequest'
        required: true
      responses:
        '200':
          description: createLocation 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '201':
          description: Location created
        '400':
          description: >-
            User needs to provide a valid organization id. If the location is
            new the id should be null
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have permission to create location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/locations/{locationId}:
    get:
      tags:
        - Locations
      summary: Get location
      description: This API can be used to get an location that you can view.
      operationId: getLocation
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: locationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Location found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Location not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    delete:
      tags:
        - Locations
      summary: Delete locations
      description: >-
        This API can be used to remove an location and its sub-locations if
        there are no registered devices.
      operationId: delete
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: locationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: delete 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '204':
          description: Location deleted
        '400':
          description: >-
            Location has registered devices or the user is deleting a root
            location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Location not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma:
    get:
      tags:
        - Rma
      summary: Get Rma Schema
      description: Get Rma Schema for an organization
      operationId: getRma
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: creationDate,desc
        - name: number
          in: query
          schema:
            type: string
            nullable: true
        - name: creationDateStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: creationDateEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: customerName
          in: query
          schema:
            type: string
            nullable: true
        - name: workCenter
          in: query
          schema:
            type: string
            nullable: true
        - name: workCenterCode
          in: query
          schema:
            type: string
            nullable: true
        - name: purchaseOrderNumber
          in: query
          schema:
            type: string
            nullable: true
        - name: receivedDateStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: receivedDateEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: estimatedRepairDateStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: estimatedRepairDateEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: store
          in: query
          schema:
            type: string
            nullable: true
        - name: shippingDateStart
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: shippingDateEnd
          in: query
          description: yyyy-MM-dd
          schema:
            pattern: \d{4}-\d{2}-\d{2}
            type: string
            nullable: true
        - name: shippingType
          in: query
          schema:
            type: string
            nullable: true
        - name: serialNumber
          in: query
          schema:
            type: string
            nullable: true
        - name: problemCode
          in: query
          schema:
            type: string
            nullable: true
        - name: materialNumber
          in: query
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: Rma Schema for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_RmaResponse_'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma/form-report/{rmaNumber}:
    get:
      tags:
        - Rma
      summary: Download Form Report
      description: Download the Form Report PDF file for the specified RMA number
      operationId: downloadFormReportFile
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: rmaNumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Form Report file found and being downloaded
          content:
            application/octet-stream: {}
        '404':
          description: Form Report file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Server error while retrieving the file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma/shipping-label/{rmaNumber}:
    get:
      tags:
        - Rma
      summary: Download Shipping Label
      description: Download the Shipping Label PDF file for the specified RMA number
      operationId: downloadShippingLabelFile
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: rmaNumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Shipping Label file found and being downloaded
          content:
            application/octet-stream: {}
        '404':
          description: Shipping Label file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Server error while retrieving the file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma/v1/products/{serialnumber}:
    get:
      tags:
        - Rma
      summary: Get Rma Product
      description: Get Rma Product for an organization
      operationId: getProductsRma
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: serialnumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Rma Product for the organization
          content:
            application/json:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma/v1/rmas/{rmanumber}/RmaForm:
    get:
      tags:
        - Rma
      summary: Get Rma Form
      description: Get Rma Form for an organization
      operationId: getRmaForm
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: rmanumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Rma Form for the organization
          content:
            application/json:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/rma/v1/rmas/{rmanumber}/shippinglabel:
    get:
      tags:
        - Rma
      summary: Get Rma Form
      description: Get Rma Form for an organization
      operationId: getRmaShippingLabel
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: rmanumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Rma Form for the organization
          content:
            application/json:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/users:
    get:
      tags:
        - Users
      summary: get all users
      description: This API allows you to get all users
      operationId: getUsers
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: page
          in: query
          description: The page number
          schema: {}
          example: '0'
        - name: size
          in: query
          description: The page size
          schema: {}
          example: '10'
        - name: sort
          in: query
          description: The field and sort order
          schema: {}
          example: id,desc
        - name: username
          in: query
          schema:
            type: string
            nullable: true
        - name: mail
          in: query
          schema:
            type: string
            nullable: true
        - name: locationId
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
              format: uuid
        - name: roles
          in: query
          schema:
            type: array
            nullable: true
            items:
              type: string
      responses:
        '200':
          description: Users found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_UserResponse_'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to the user list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    put:
      tags:
        - Users
      summary: Update user
      description: >-
        This API allows you to update users. If the mail or the id is already
        present in the system, the user will be updated
      operationId: updateUser
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        description: The user to  update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateRequest'
        required: true
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access update users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
    post:
      tags:
        - Users
      summary: Create user
      description: This API allows you to create a user
      operationId: createUser
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
      requestBody:
        description: The user to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAddRequest'
        required: true
      responses:
        '200':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to create users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/users/{id}:
    get:
      tags:
        - Users
      summary: Get user by id
      description: >-
        This API allow you to find the users, the API tries to find a match for
        the string passed by checking the name or mailing address on the system.
      operationId: getUser
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: c2b176f7-3bf6-484b-9118-cd6e5c8e0198
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 7fd28f13-7dab-4a1d-9266-cbc82cafa4eb
      responses:
        '200':
          description: The user found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: You don't have access to this user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The user was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
  /api/{organizationId}/users/{userId}:
    delete:
      tags:
        - Users
      summary: Delete user
      description: This API allow you to delete one user if you have the permission.
      operationId: deleteUser
      parameters:
        - name: organizationId
          in: path
          description: The organization id
          required: true
          schema: {}
          example: ee125af1-7446-4cf1-9e3a-d75c16a74ba6
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: deleteUser 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '204':
          description: The user has been deleted successfully.
        '400':
          description: The user needs to provide a valid organization id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: The user is not authorized to delete the user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: The user does not exist in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearerAuth: []
components:
  schemas:
    Action.ActionStatus:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - COMPLETED
        - FAILED
    ActionDataCommand:
      type: object
      properties:
        command:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActionDataCommandDetails'
        payload:
          type: string
          nullable: true
        files:
          type: array
          nullable: true
          items:
            type: string
    ActionDataCommandDetails:
      type: object
      properties:
        id:
          type: integer
          format: int64
          nullable: true
        name:
          type: string
          nullable: true
    ActionDetails:
      required:
        - data
        - description
        - deviceGroup
        - id
        - location
        - name
        - owner
        - progress
        - status
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        deviceGroup:
          $ref: '#/components/schemas/DeviceGroupDetails'
        data:
          $ref: '#/components/schemas/ActionDataCommand'
        owner:
          $ref: '#/components/schemas/OwnerDetails'
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/Action.ActionStatus'
        progress:
          $ref: '#/components/schemas/ActionResponse.ActionProgress'
        location:
          $ref: '#/components/schemas/LocationResponse'
    ActionMinimalResponse:
      required:
        - description
        - id
        - name
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
    ActionRequest:
      required:
        - data
        - description
        - deviceGroupId
        - name
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        deviceGroupId:
          type: string
          format: uuid
        data:
          $ref: '#/components/schemas/ActionRequest.ActionDataCommandRequest'
    ActionRequest.ActionDataCommandRequest:
      required:
        - command
      type: object
      properties:
        command:
          type: integer
          format: int64
        payload:
          type: string
          nullable: true
        files:
          type: array
          nullable: true
          items:
            type: string
    ActionResponse:
      required:
        - commandIds
        - data
        - description
        - deviceGroup
        - deviceIds
        - id
        - locationId
        - name
        - owner
        - progress
        - status
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        deviceIds:
          type: array
          items:
            type: string
        deviceGroup:
          $ref: '#/components/schemas/DeviceGroupDetails'
        commandIds:
          type: array
          items:
            type: string
            format: uuid
        data:
          $ref: '#/components/schemas/ActionDataCommand'
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/Action.ActionStatus'
        progress:
          $ref: '#/components/schemas/ActionResponse.ActionProgress'
        owner:
          $ref: '#/components/schemas/OwnerDetails'
        locationId:
          type: string
          format: uuid
    ActionResponse.ActionProgress:
      required:
        - completed
        - created
        - failed
        - inProgress
        - pending
        - total
      type: object
      properties:
        total:
          type: integer
          format: int32
        created:
          type: integer
          format: int32
        completed:
          type: integer
          format: int32
        failed:
          type: integer
          format: int32
        pending:
          type: integer
          format: int32
        inProgress:
          type: integer
          format: int32
    CategoryDeviceCount:
      required:
        - connectedDevices
        - id
        - name
        - totalDevices
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        parentId:
          type: integer
          format: int64
          nullable: true
        templateId:
          type: integer
          format: int64
          nullable: true
        totalDevices:
          type: integer
          format: int32
        connectedDevices:
          type: integer
          format: int32
        image:
          type: string
          nullable: true
    CommandDetails:
      required:
        - command
        - device
        - id
        - status
        - statusMessage
      type: object
      properties:
        id:
          type: string
          format: uuid
        command:
          type: string
        request:
          type: object
          additionalProperties: true
          nullable: true
        response:
          type: object
          additionalProperties: true
          nullable: true
        status:
          $ref: '#/components/schemas/CommandStatus'
        statusMessage:
          type: string
        device:
          $ref: '#/components/schemas/DeviceResponse'
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
    CommandRequestPayload:
      type: object
      properties:
        payload:
          nullable: true
        files:
          type: array
          nullable: true
          items:
            type: string
    CommandResponse:
      required:
        - attachments
        - command
        - deviceId
        - id
        - status
        - statusMessage
      type: object
      properties:
        id:
          type: string
          format: uuid
        command:
          type: string
        request:
          type: object
          additionalProperties: true
          nullable: true
        response:
          type: object
          additionalProperties: true
          nullable: true
        status:
          $ref: '#/components/schemas/CommandStatus'
        commandStatusCode:
          type: string
          nullable: true
        statusMessage:
          type: string
        deviceId:
          type: string
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        owner:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OwnerDetails'
        action:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActionMinimalResponse'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/FileRecordSummary'
    CommandStatus:
      type: string
      enum:
        - CREATED
        - PENDING
        - IN_PROGRESS
        - COMPLETED
        - FAILED
    Device.StatusMessage:
      required:
        - connected
        - timestamp
      type: object
      properties:
        connected:
          type: boolean
        timestamp:
          type: string
          format: date-time
    DeviceAddRequest:
      required:
        - deviceCategoryId
        - enabled
        - id
        - locationId
        - name
      type: object
      properties:
        id:
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z0-9.:\-_]+$
          type: string
        name:
          maxLength: 50
          minLength: 1
          type: string
        locationId:
          type: string
          format: uuid
        deviceCategoryId:
          type: integer
          format: int64
        enabled:
          type: boolean
        parentId:
          type: string
          nullable: true
        licenseKey:
          type: string
          nullable: true
    DeviceCategory:
      required:
        - deviceType
        - enabled
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
          nullable: true
        name:
          type: string
        enabled:
          type: boolean
        deviceTemplate:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/DeviceTemplate'
        image:
          type: string
          nullable: true
        deviceType:
          $ref: '#/components/schemas/DeviceType'
    DeviceCategoryResponse:
      required:
        - deviceType
        - id
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        deviceTemplateId:
          type: integer
          format: int64
          nullable: true
        parentId:
          type: integer
          format: int64
          nullable: true
        image:
          type: string
          nullable: true
        deviceType:
          $ref: '#/components/schemas/DeviceType'
    DeviceConfigType:
      type: string
      enum:
        - SCAN2DEPLOY
        - ALADDIN
        - JSON
        - UNKNOWN
    DeviceCredentials:
      required:
        - primaryKey
        - scope
        - secondaryKey
      type: object
      properties:
        scope:
          type: string
        primaryKey:
          type: string
        secondaryKey:
          type: string
    DeviceGroupDetails:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
        name:
          type: string
          nullable: true
    DeviceGroupFilter:
      required:
        - field
        - operator
        - value
      type: object
      properties:
        field:
          $ref: '#/components/schemas/FilterField'
        operator:
          $ref: '#/components/schemas/FilterOperator'
        value: {}
    DeviceGroupFilterRequest:
      required:
        - query
      type: object
      properties:
        locationId:
          type: string
          format: uuid
          nullable: true
        categoryId:
          type: integer
          format: int64
          nullable: true
        query:
          type: array
          items:
            $ref: '#/components/schemas/DeviceGroupFilter'
    DeviceGroupRequest:
      required:
        - categoryId
        - locationId
        - query
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        query:
          type: array
          items:
            $ref: '#/components/schemas/DeviceGroupFilter'
        locationId:
          type: string
          format: uuid
        categoryId:
          type: integer
          format: int64
    DeviceGroupResponse:
      required:
        - id
        - name
        - owner
        - query
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        query:
          type: array
          items:
            $ref: '#/components/schemas/DeviceGroupFilter'
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        locationId:
          type: string
          format: uuid
          nullable: true
        categoryId:
          type: integer
          format: int64
          nullable: true
        owner:
          $ref: '#/components/schemas/OwnerDetails'
    DeviceGroupUpdateRequest:
      required:
        - query
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        query:
          type: array
          items:
            $ref: '#/components/schemas/DeviceGroupFilter'
        locationId:
          type: string
          format: uuid
          nullable: true
        categoryId:
          type: integer
          format: int64
          nullable: true
    DeviceParent:
      required:
        - id
        - name
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    DeviceResponse:
      required:
        - connection
        - deviceCategoryId
        - deviceType
        - enabled
        - id
        - locationId
        - name
        - properties
        - provisioned
        - status
        - telemetries
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        enabled:
          type: boolean
        provisioned:
          type: boolean
        locationId:
          type: string
          format: uuid
        deviceType:
          $ref: '#/components/schemas/DeviceType'
        deviceCategoryId:
          type: integer
          format: int64
        properties:
          type: object
          additionalProperties: true
        telemetries:
          type: object
          additionalProperties: true
        status:
          $ref: '#/components/schemas/DeviceStatus'
        connection:
          $ref: '#/components/schemas/Device.StatusMessage'
        parent:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/DeviceParent'
        lastKnownConfig:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/FileRecordSummary'
        license:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/LicenseDetails'
    DeviceStatus:
      type: string
      enum:
        - WAITING_FOR_APPROVAL
        - REGISTERED
        - BLOCKED
        - PROVISIONED
    DeviceTemplate:
      required:
        - deviceCommands
        - deviceCommandsFromTemplateTree
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
          nullable: true
        name:
          type: string
        deviceCommands:
          type: array
          items:
            $ref: '#/components/schemas/TemplateCommand'
        deviceCommandsFromTemplateTree:
          type: array
          items:
            $ref: '#/components/schemas/TemplateCommand'
    DeviceTemplateResponse:
      required:
        - deviceCommands
        - id
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        deviceCommands:
          type: array
          items:
            $ref: '#/components/schemas/TemplateCommand'
    DeviceType:
      type: string
      enum:
        - iotEdge
        - iotDevice
        - host
    DeviceUpdateRequest:
      required:
        - id
      type: object
      properties:
        id:
          maxLength: 50
          type: string
        name:
          maxLength: 50
          type: string
          nullable: true
        locationId:
          type: string
          format: uuid
          nullable: true
        deviceCategoryId:
          type: integer
          format: int64
          nullable: true
        enabled:
          type: boolean
          nullable: true
        parentId:
          type: string
          nullable: true
        licenseKey:
          type: string
          nullable: true
    DevicesDeleteRequest:
      required:
        - ids
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
    DevicesDeleteResponse:
      required:
        - failedDevices
      type: object
      properties:
        failedDevices:
          type: object
          additionalProperties:
            type: string
    ErrorMessage:
      required:
        - errors
        - time
      type: object
      properties:
        name:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        requestId:
          type: string
          nullable: true
        time:
          type: string
          format: date-time
        errors:
          type: array
          items:
            type: object
    FileLinkResponse:
      required:
        - link
      type: object
      properties:
        link:
          type: string
        expire:
          type: string
          format: date-time
          nullable: true
    FileRecord.FileRecordResponse:
      required:
        - dataType
        - filepath
        - name
        - size
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
        description:
          type: string
          nullable: true
        filepath:
          type: string
        dataType:
          $ref: '#/components/schemas/DeviceConfigType'
        size:
          type: integer
          format: int64
        owner:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OwnerDetails'
        categoryId:
          type: integer
          format: int64
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    FileRecordSummary:
      required:
        - name
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
    FileTypesResponse:
      type: object
      properties:
        totalFiles:
          type: integer
          format: int32
          nullable: true
        deviceTypes:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/DeviceConfigType'
    FilterField:
      type: string
      enum:
        - DEVICE_ID
        - DEVICE_NAME
        - LOCATION_ID
        - CATEGORY_ID
        - TYPE
        - CREATION_DATE
        - CONNECTION
        - STATUS
        - PARENT_NAME
    FilterOperator:
      type: string
      enum:
        - EQUALS
        - NOT_EQUALS
        - IN
        - NOT_IN
        - IS
        - IS_NOT
        - STARTS_WITH
        - ENDS_WITH
        - CONTAINS
        - NOT_CONTAINS
        - BETWEEN
    License:
      required:
        - created
        - customerId
        - licenseKey
        - metadata
        - name
        - organization
        - requireCheckIn
        - status
        - type
        - updated
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
        type:
          type: string
        name:
          maxLength: 255
          minLength: 1
          type: string
        licenseKey:
          maxLength: 500
          minLength: 1
          pattern: '[A-Z0-9]{6}-[A-Z0-9]{6}-[A-Z0-9]{6}-[A-Z0-9]{6}-[A-Z0-9]{6}-V\d'
          type: string
        expiry:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/LicenseStatus'
        maxMachines:
          minimum: 0
          type: integer
          format: int64
          nullable: true
        lastValidated:
          type: string
          format: date-time
          nullable: true
        customerId:
          type: string
          format: uuid
        requireCheckIn:
          type: boolean
        lastCheckIn:
          type: string
          format: date-time
          nullable: true
        nextCheckIn:
          type: string
          format: date-time
          nullable: true
        metadata:
          type: object
          additionalProperties: true
        organization:
          $ref: '#/components/schemas/Organization'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
        licenseProductType:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/LicenseProductType'
    LicenseDetails:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
        name:
          type: string
          nullable: true
    LicenseProductType:
      required:
        - deviceCategory
        - licenseProductType
      type: object
      properties:
        licenseProductType:
          type: string
        deviceCategory:
          $ref: '#/components/schemas/DeviceCategory'
    LicenseStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
        - EXPIRING
        - EXPIRED
        - SUSPENDED
    LicenseTag:
      type: string
      enum:
        - BASIC
        - ADVANCED
    LocationAddRequest:
      required:
        - name
        - parentId
      type: object
      properties:
        name:
          maxLength: 50
          minLength: 1
          type: string
        parentId:
          type: string
          format: uuid
    LocationResponse:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        parentId:
          type: string
          format: uuid
          nullable: true
    LocationUpdateRequest:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          maxLength: 50
          minLength: 4
          type: string
          nullable: true
        parentId:
          type: string
          format: uuid
          nullable: true
    NotificationStatus:
      type: string
      enum:
        - I
        - P
        - C
    Organization:
      required:
        - enrollment
        - tokens
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
        name:
          type: string
          nullable: true
        enrollment:
          type: object
          additionalProperties: true
        tokens:
          $ref: '#/components/schemas/OrganizationTokens'
        iotOrgId:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    OrganizationCounterResponse:
      required:
        - commandCount
        - id
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        commandCount:
          type: integer
          format: int32
        startDate:
          type: string
          format: date-time
          nullable: true
        endDate:
          type: string
          format: date-time
          nullable: true
    OrganizationResponse:
      required:
        - enrollment
        - id
        - user
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        enrollment:
          type: object
          additionalProperties: true
        user:
          $ref: '#/components/schemas/OwnerDetails'
    OrganizationTokens:
      required:
        - data
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationTokens.TokenEntry'
        iotSasToken:
          type: string
          nullable: true
    OrganizationTokens.TokenEntry:
      required:
        - key
        - value
      type: object
      properties:
        key:
          type: string
        value:
          type: string
    OrganizationWithRolesResponse:
      required:
        - id
        - roles
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        roles:
          type: array
          items:
            $ref: '#/components/schemas/RoleResponse'
    OwnerDetails:
      required:
        - id
        - mail
      type: object
      properties:
        id:
          type: string
          format: uuid
        mail:
          type: string
    Page_ActionResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/ActionResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_CommandDetails_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/CommandDetails'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_CommandResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/CommandResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_DeviceGroupResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DeviceGroupResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_DeviceResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DeviceResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_FileRecord.FileRecordResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/FileRecord.FileRecordResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_License_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/License'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_LocationResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/LocationResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_RmaResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/RmaResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Page_UserResponse_:
      required:
        - content
        - empty
        - numberOfElements
        - offset
        - pageNumber
        - pageable
        - size
        - totalPages
        - totalSize
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/UserResponse'
        pageable:
          allOf:
            - $ref: '#/components/schemas/Pageable'
            - required:
                - mode
                - number
        pageNumber:
          type: integer
          format: int32
        offset:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        empty:
          type: boolean
        numberOfElements:
          type: integer
          format: int32
        totalSize:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    Pageable:
      required:
        - mode
        - number
        - size
        - sort
      type: object
      properties:
        number:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        mode:
          $ref: '#/components/schemas/Pageable.Mode'
        sort:
          $ref: '#/components/schemas/Sort'
      allOf:
        - $ref: '#/components/schemas/Sort'
    Pageable.Mode:
      type: string
      enum:
        - CURSOR_NEXT
        - CURSOR_PREVIOUS
        - OFFSET
    RmaItemResponse:
      required:
        - materialNumber
        - serialNumber
      type: object
      properties:
        serialNumber:
          type: string
        problemCode:
          type: string
          nullable: true
        problemCode2:
          type: string
          nullable: true
        problemCodeDescription:
          type: string
          nullable: true
        materialNumber:
          type: string
        materialDescription:
          type: string
          nullable: true
        customerMaterialDescription:
          type: string
          nullable: true
        workCenter:
          type: string
          nullable: true
        workCenterCode:
          type: string
          nullable: true
        status:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/NotificationStatus'
        trackingNumber:
          type: string
          nullable: true
        shipDate:
          type: string
          format: date-time
          nullable: true
        receivedDate:
          type: string
          format: date-time
          nullable: true
        estimatedRepairDate:
          type: string
          format: date-time
          nullable: true
        problemDescription:
          type: string
          nullable: true
        additionalNote:
          type: string
          nullable: true
    RmaResponse:
      required:
        - formReportAvailable
        - items
        - number
        - shippingLabelAvailable
      type: object
      properties:
        number:
          type: string
        creationDate:
          type: string
          format: date-time
          nullable: true
        customerName:
          type: string
          nullable: true
        purchaseOrderNumber:
          type: string
          nullable: true
        store:
          type: string
          nullable: true
        shipment:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Shipment'
        formReportAvailable:
          type: boolean
        shippingLabelAvailable:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/RmaItemResponse'
    RoleEnum:
      type: string
      enum:
        - admin
        - operator
        - viewer
    RoleRequest:
      required:
        - locationId
        - role
      type: object
      properties:
        role:
          $ref: '#/components/schemas/RoleEnum'
        locationId:
          type: string
          format: uuid
    RoleResponse:
      required:
        - location
        - role
      type: object
      properties:
        role:
          $ref: '#/components/schemas/RoleEnum'
        location:
          $ref: '#/components/schemas/LocationResponse'
    Shipment:
      required:
        - addressOfShipToParty
        - shipToParty
        - shippingType
      type: object
      properties:
        addressOfShipToParty:
          type: string
        shippingType:
          type: string
        shipToParty:
          type: string
    Sort:
      required:
        - orderBy
      type: object
      properties:
        orderBy:
          type: array
          items:
            $ref: '#/components/schemas/Sort.Order'
    Sort.Order:
      required:
        - direction
        - ignoreCase
        - property
      type: object
      properties:
        ignoreCase:
          type: boolean
        direction:
          $ref: '#/components/schemas/Sort.Order.Direction'
        property:
          type: string
        ascending:
          type: boolean
    Sort.Order.Direction:
      type: string
      enum:
        - ASC
        - DESC
    TemplateCommand:
      required:
        - id
        - licenseTag
        - name
      type: object
      properties:
        id:
          type: integer
          format: int64
          nullable: true
        name:
          type: string
        licenseTag:
          $ref: '#/components/schemas/LicenseTag'
    Unit:
      type: object
    UpdateFileDTO:
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        categoryId:
          type: integer
          format: int64
          nullable: true
    UserAddRequest:
      required:
        - mail
        - name
        - role
      type: object
      properties:
        name:
          maxLength: 50
          minLength: 4
          type: string
        mail:
          type: string
          format: email
        role:
          $ref: '#/components/schemas/RoleRequest'
    UserResponse:
      required:
        - id
        - mail
        - name
        - preferences
        - profile
        - roles
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        mail:
          type: string
        profile:
          type: object
          additionalProperties: true
        preferences:
          type: object
          additionalProperties: true
        roles:
          type: array
          items:
            $ref: '#/components/schemas/RoleResponse'
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    UserUpdateMeRequest:
      type: object
      properties:
        name:
          maxLength: 50
          minLength: 4
          type: string
          nullable: true
        profile:
          type: object
          additionalProperties: true
          nullable: true
        preferences:
          type: object
          additionalProperties: true
          nullable: true
    UserUpdateRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
        name:
          maxLength: 50
          minLength: 4
          type: string
          nullable: true
        mail:
          type: string
          format: email
          nullable: true
        role:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RoleRequest'
    UserWithOrgsResponse:
      required:
        - id
        - mail
        - name
        - organizations
        - preferences
        - profile
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        mail:
          type: string
        profile:
          type: object
          additionalProperties: true
        preferences:
          type: object
          additionalProperties: true
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationWithRolesResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: JWT authentication
      scheme: bearer
      bearerFormat: JWT
