openapi: 3.0.4
info:
  title: Public APIs
  description: WEDA Public APIs
  version: 1.0.0
servers:
  - url: https://{domain}/{tenant}/weda
    description: >-
      WEDA API Endpoint. Replace {domain} with your WEDA domain and {tenant}
      with your tenant path. For example:
      https://tpe.cloud.advantech.com/demo/weda
    variables:
      domain:
        default: tpe.cloud.advantech.com
      tenant:
        default: demo
tags:
  - name: ___swagger_1-iam_swagger_json_Auth
    x-displayName: Auth
  - name: ___swagger_1-iam_swagger_json_Identity & Access
    x-displayName: Identity & Access
  - name: ___swagger_1-iam_swagger_json_Orgs
    x-displayName: Orgs
  - name: ___swagger_1-iam_swagger_json_OrgUsers
    x-displayName: OrgUsers
  - name: ___swagger_1-iam_swagger_json_Users
    x-displayName: Users
  - name: ___swagger_2-device-management_swagger_json_Devices
    x-displayName: Devices
  - name: ___swagger_2-device-management_swagger_json_WEDA Node Credentials
    x-displayName: WEDA Node Credentials
  - name: ___swagger_6-tunnel-management_swagger_json_Tunnels
    x-displayName: Tunnels
  - name: ___swagger_6-tunnel-management_swagger_json_Tunnels/Servers
    x-displayName: Tunnels/Servers
  - name: ___swagger_4-container-management_swagger_json_Container Deployments
    x-displayName: Container Deployments
  - name: ___swagger_4-container-management_swagger_json_Container Commands
    x-displayName: Container Commands
  - name: ___swagger_4-container-management_swagger_json_Container Stacks
    x-displayName: Container Stacks
  - name: ___swagger_4-container-management_swagger_json_Container Registries
    x-displayName: Container Registries
  - name: ___swagger_4-container-management_swagger_json_Internal
    x-displayName: Internal
  - name: ___swagger_5-datapoints_swagger_json_Channel
    x-displayName: Channel
  - name: ___swagger_5-datapoints_swagger_json_ChannelType
    x-displayName: ChannelType
  - name: ___swagger_5-datapoints_swagger_json_FunctionTransfer
    x-displayName: FunctionTransfer
  - name: ___swagger_5-datapoints_swagger_json_Message
    x-displayName: Message
  - name: ___swagger_5-datapoints_swagger_json_RuleEngine
    x-displayName: RuleEngine
  - name: ___swagger_5-datapoints_swagger_json_Telemetry
    x-displayName: Telemetry
  - name: ___swagger_5-datapoints_swagger_json_Template
    x-displayName: Template
  - name: ___swagger_5-datapoints_swagger_json_Notifications
    x-displayName: Notifications
  - name: ___swagger_2-device-management_swagger_json_Batch Tasks
    x-displayName: Batch Tasks
  - name: ___swagger_5-datapoints_swagger_json_Data Objects
    x-displayName: Data Objects
  - name: ___swagger_7-reports_swagger_json_Reports
    x-displayName: Reports
  - name: ___swagger_7-reports_swagger_json_UsageSummaryTask
    x-displayName: UsageSummaryTask
paths:
  /api/v1/auth/tokens:
    post:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Create JWT access token
      description: >-
        Exchanges an existing authentication credential (header, body, cookie or
        refresh token) for a JWT access token.


        **Authentication Methods**


        **1. Authorization Header (Recommended)**

        Use the Authorization Bearer header with a valid token to perform the
        token exchange.

        ```

        Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

        ```


        **2. Cookie Authentication**

        Use the *'AdvOidc.Login'* cookie (automatically detected if present).


        **3. Refresh Token**

        Use grant_type=refresh_token with a valid refresh token to obtain a new
        JWT.

        ```json

        {
          "refreshToken": "d891ac59aef945a3b67dc2ef569b20aa"
        }

        ```


        **Parameters**

        * `grant_type`: Set to `refresh_token` when using a refresh token to
        obtain a new JWT

        * `refreshToken` (string, optional): Required when grant_type is
        refresh_token. Provide a valid Refresh Token to obtain a new JWT


        **Responses**

        * `201 Created`: Successfully returns a new access_token  

        * `403 Forbidden`: No valid credentials found


        **Security**

        * This API supports multiple authentication methods for flexibility

        * Priority order: Refresh token → Authorization header → Cookie

        * Applicable for both public and internal applications, but
        authentication is required
      parameters:
        - name: grant_type
          in: query
          description: 'Grant type: use ''cc'' for refresh token operation'
          schema:
            $ref: '#/components/schemas/RefreshGrantType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenBodyDto'
            example:
              token: null
              refreshToken: d891ac59aef945a3b67dc2ef569b20aa
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResultDto'
              example:
                accessToken: >-
                  eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCc8.eyJleHAiOjE3NjExODQ0NTgsXmlzcyI6IkVkZ2VTeW5jLkF1dGhTZXJ2ZXIiLCJhdWQiOiJFZGdlU3luYy5BUEkiLCJpZCI6IjNhMWMxNjVlLTg2YmUtZDY3Yy03ZjVlLTY1ZjljMGZhZTAxNCIsInN1YiI6ImJhNmRjNzUyLTgxMDgtNGVjNS1hM2NhLWFmMDFhYjY0ODlkNiIsInJvbGUiOiJhZG1pbiIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJhZG1pbiJdfSwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW5AYWR2YW50ZWNoLmNvbSIsImVtYWlsIjoiYWRtaW5AYWR2YW50ZWNoLmNvbSIsInJlc291cmNlX2FjY2VzcyI6eyIzYTFiMDA0NS0xYmRmLTI1YWQtMzg3Ny01ZTdlY2M5ZTBmM2EiOnsib3JnTmFtZSI6IlNlY29uZE9yZ18yMSIsIm9yZ1JvbGUiOiJhZG1pbiIsInJvbGVzIjpbXX0sIjNhMWIwMDNjLWE0MmMtZWU0ZS01ZDViLTcyNDlmYTljYWUzNCI6eyJvcmdOYW1lIjoiRmlyc3RPcmcyIiwib3JnUm9sZSI6ImFkbWluIiwicm9sZXMiOltdfSwiM2ExYjAwM2ItM2VjMS0xNzkyLTQ0NzYtMTI5N2VmMGMyOGE1Ijp7Im9yZ05hbWUiOiJSb290T3JnIiwib3JnUm9sZSI6ImFkbWluIiwicm9sZXMiOltdfSwiM2ExZDAyNDQtMGQyMy1kNjQ0LWRjOWUtNzEwZjRkOWI4MjFlIjp7Im9yZ05hbWUiOiJSb290Q2hpbGQwMSIsIm9yZ1JvbGUiOiJhZG1pbiIsInJvbGVzIjpbXX0sIjNhMWQwMjQ1LTA2NTUtNzI0Ny1jN2M2LWYyZDIyMWVkM2YzYSI6eyJvcmdOYW1lIjoiUm9vdENoaWxkMDIiLCJvcmdSb2xlIjoiYWRtaW4iLCJyb2xlcyI6W119fSwidGVuYW50SWQiOiJ5eWRzIiwic3JwX25hbWUiOiJlZGdlc3luYyJ9.XqET_6BoV8D1UXhgqQQro8AOG7faeS2loTgJMRRycuFtbrAHMgGBJecFKqRlVsSrouBZZp62mfbpC9dfQAGVddadvwKza3P6u26WwSvVUmj67rL8rJfhFNiB0bAsqxK6yNK50MIxBYtCM_KpdEeDG-1X04TNgsDYZ5nXlxGcUzzNVPceVocfmTa2I6sVEYJCxCFsZRNdz-pUpVT11J97gTIAO_lqAanVI9H8aKtEOkLF844sm8NAKynogJhySGjhM79dbcdClPICYJZ9IVo1IL6VlNhyui3PkZKD0h2DA32xCScOdZI7klSg1x5o1r1_oMV-b03cxtyTxjERCCxTDA
                refreshToken: d891ac59aef945a3b67dc2ef569b20aa
                expiresIn: 7200
                tokenType: Bearer
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/oauth2/client-credentials:
    post:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Create a Client Credential.
      description: Create a new Client Credential with specified scopes and expiration.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePatDto'
            example:
              name: string
              expiredAt: '2026-09-01T00:00:00Z'
              scopes:
                - dataobject.read
              deviceIds:
                - string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatDetailDto'
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get all Client Credentials.
      description: Retrieve all Client Credentials.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PatDto'
              example:
                - clientCredentialId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  name: string
                  clientId: string
                  createdAt: '2026-09-01T00:00:00Z'
                  expiredAt: '2026-09-01T00:00:00Z'
                  scopes:
                    - dataobject.read
                  deviceIds:
                    - string
      security:
        - oidc: []
        - Bearer: []
  /api/v1/oauth2/client-credentials/{clientCredentialId}:
    delete:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Delete a Client Credential by ID.
      description: Revoke and delete a Client Credential by its ID.
      parameters:
        - name: clientCredentialId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get organizations (root or sub-orgs)
      description: >-
        Retrieve organizations in multiple formats:

        * Paged results (`default`)

        * Flat list (`view=list`)

        * Hierarchical tree (`view=tree`)


        **Parameters**

        * `parentOrgId` (Guid, optional): retrieve sub-organizations under a
        specific parent.

        * `view` (enum, optional): "list", "tree", or "page" (default).

        * `skipCount`, `maxResultCount`, `sorting`: standard paging/sorting
        fields.

        * `sorting`: Sorting criteria in the format: 'PropertyName ASC|DESC'.
        Available properties: name, id.


        **Responses**

        * `200 OK`: returns paged data, list, or tree depending on `view`.

        **Security**


        * This API requires authentication.
      parameters:
        - name: parentOrgId
          in: query
          description: >-
            The parent organization ID. If specified, retrieves
            sub-organizations under this org. If omitted, retrieves root-level
            organizations.  
                    Example : 783707f1-0659-4892-a872-8f506d225d7b
          schema:
            type: string
            description: >-
              The parent organization ID. If specified, retrieves
              sub-organizations under this org. If omitted, retrieves root-level
              organizations.  
                      Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
            nullable: true
        - name: view
          in: query
          description: >-
            View mode: 'list' for flat list, 'tree' for hierarchical tree view,
            'page' for paged results (default is 'page').  
                    Example : page, list, tree
          schema:
            $ref: '#/components/schemas/ViewType'
        - name: skipCount
          in: query
          description: Number of records to skip for pagination. Must be 0 or greater.
          schema:
            type: integer
            description: Number of records to skip for pagination. Must be 0 or greater.
            format: int32
        - name: maxResultCount
          in: query
          description: Maximum number of records to return (1–1000).
          schema:
            type: integer
            description: Maximum number of records to return (1–1000).
            format: int32
            nullable: true
        - name: sorting
          in: query
          description: 'Sorting criteria in the format: ''PropertyName ASC|DESC''.'
          schema:
            type: string
            description: 'Sorting criteria in the format: ''PropertyName ASC|DESC''.'
            nullable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - name: Advantech HQ
                    orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    parentOrgId: null
                  - name: R&D Department
                    orgId: 8c77338d-0f1f-4ac8-97eb-0ef3a1b68e23
                    parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    post:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Create a new organization
      description: >-
        Add a new organization with the provided details.


        **Parameters**

        * Request body:

        // - `input` (CreateOrgDto, required): the organization definition,
        including:  

        - `name` (string, required, max length 100): the name of the
        organization.  

        - `parentOrgId` (string, optional): the ID of the parent organization,
        if applicable.

        - `description` (string, optional, max length 200): description of the
        organization.

        - `admins` (list of userId, optional): list of admin users for this
        organization.


        **Responses**


        * `201 Created`: new organization created successfully.

        * `400 Bad Request`: invalid input data.

        * `403 Forbidden`: caller does not have permission to create orgs under
        the specified parent.

        * `404 Not Found`: specified parent organization not found.

        * `409 Conflict`: organization name already exists.


        **Security**


        * This API requires authentication.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrgDto'
            example:
              parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
              admins:
                - userId: 783707f1-0659-4892-a872-8f506d225d7b
                - userId: 783707f1-0659-4892-a872-8f506d225d7c
              name: OrgSample
              description: This is a sample organization.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrgResponseDto'
              example:
                name: OrgSample
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
                description: Sample organization
                admins:
                  - userId: 783707f1-0659-4892-a872-8f506d225d7b
                    orgRole: admin
                    name: AdminUserSample
                dateCreated: '2026-05-21T10:32:09.236647Z'
                dateModified: '2026-05-21T10:32:09.2366765Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get a specific organization by ID
      description: >-
        Retrieve detailed information of an organization by its unique
        identifier.


        **Parameters**


        * `orgId` (Guid, required): unique identifier of the organization.


        **Responses**


        * `200 OK`: returns the organization details.

        * `404 Not Found`: no organization found with the given ID.


        **Security**


        * This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: |-
            The ID of the organization.  
                Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the organization.  
                  Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgDto'
              example:
                name: OrgSample
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Update an existing organization
      description: >-
        Update the name, description of an existing organization. ParentOrgId is
        immutable and must match the existing value.


        **Parameters**


        * `orgId` (Guid, required): ID of the organization to update.

        * Request body: `CreateUpdateOrgDto` with updated values.

        - `name` (string, required, max length 100): updated organization name.
        Must be globally unique (case-insensitive, whitespace-normalized).

        // - `parentOrgId` (string, required): must match the existing
        parentOrgId — modification is not allowed in v1.0.

        - `description` (string, optional, max length 200): updated organization
        description.


        **Responses**


        * `200 OK`: organization updated successfully.

        * `400 Bad Request`: invalid input (name conflict, parentOrgId mismatch,
        field length exceeded).

        * `403 Forbidden`: caller does not have admin role in this organization.

        * `404 Not Found`: organization not found.


        **Security**


        * This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: |-
            The ID of the organization.  
                    Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the organization.  
                      Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateOrgDto'
            example:
              name: OrgSample
              description: This is a sample organization.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOrgResponseDto'
              example:
                orgId: 8c77338d-0f1f-4ac8-97eb-0ef3a1b68e23
                name: OrgSampleUpdated
                description: Updated description
                dateModified: '2025-12-20T08:45:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Delete an organization
      description: >-
        Remove an organization by its ID. Requires confirmation of the
        organization name.


        **Parameters**


        * `orgId` (Guid, required): ID of the organization.

        * `orgName` (string, required): The name of the organization, used for
        confirmation.


        **Responses**


        * `204 No Content`: organization deleted successfully.

        * `400 Bad Request`: orgName does not match the actual organization
        name.

        * `403 Forbidden`: caller is not admin, target is root org, org has
        sub-organizations, or org has other users.

        * `404 Not Found`: organization not found.


        **Security**


        * This API requires authentication.

        * Only an `admin` of the target org may delete it.

        * Root organizations cannot be deleted.

        * Organizations with sub-orgs or other users cannot be deleted.
      parameters:
        - name: orgId
          in: path
          description: |-
            The ID of the organization.  
                    Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the organization.  
                      Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: orgName
          in: query
          description: |-
            The name of the organization for deletion confirmation.  
                    Example : MyOrg
          required: true
          schema:
            type: string
            description: |-
              The name of the organization for deletion confirmation.  
                      Example : MyOrg
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/children:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get children organizations up to certain depth
      description: >-
        Retrieve child organizations under a given organization up to a
        specified depth.


        **Parameters**


        * `orgId` (Guid, required): ID of the parent organization.

        * `depth` (int, optional, default=1): Number of levels of children to
        retrieve.


        **Responses**


        * `200 OK`: returns children org tree.
      parameters:
        - name: orgId
          in: path
          description: |-
            The ID of the organization.  
                    Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the organization.  
                      Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: depth
          in: query
          description: |-
            Number of levels of children to retrieve.  
                    Example : 1, 2, 3
          schema:
            type: integer
            description: |-
              Number of levels of children to retrieve.  
                      Example : 1, 2, 3
            format: int32
            default: 1
            nullable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgTreeDto'
              example:
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                name: Advantech HQ
                parentOrgId: null
                children:
                  - orgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                    name: R&D Division
                    parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    children:
                      - orgId: d5b84af3-8b4b-4e71-8b32-c23d9dce7bb3
                        name: AI Department
                        parentOrgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                        children: []
                      - orgId: 77dcb763-3c46-49a8-92ab-451c7c6d47f2
                        name: IoT Department
                        parentOrgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                        children: []
                  - orgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                    name: Sales Division
                    parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    children:
                      - orgId: 2e8708f4-9ad5-4bb9-b16c-53cb5f7c1f71
                        name: Asia Region
                        parentOrgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                        children: []
                      - orgId: 95b49b55-f021-4f70-92b3-256f4a7e20a6
                        name: Europe Region
                        parentOrgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                        children: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/parents:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get parent organizations up to certain depth
      description: >-
        Retrieve parent organizations of a given organization up to a specified
        depth.


        **Parameters**


        * `orgId` (Guid, required): ID of the child organization.

        * `depth` (int, optional, default=1): Number of parent levels to
        retrieve.


        **Responses**


        * `200 OK`: returns parent org tree.
      parameters:
        - name: orgId
          in: path
          description: |-
            The ID of the organization.  
                    Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the organization.  
                      Example : 783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: depth
          in: query
          description: 'Depth of parent levels to retrieve. Example: 1, 2, 3'
          schema:
            type: integer
            description: 'Depth of parent levels to retrieve. Example: 1, 2, 3'
            format: int32
            default: 1
            nullable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgTreeDto'
              example:
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                name: Advantech HQ
                parentOrgId: null
                children:
                  - orgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                    name: R&D Division
                    parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    children:
                      - orgId: d5b84af3-8b4b-4e71-8b32-c23d9dce7bb3
                        name: AI Department
                        parentOrgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                        children: []
                      - orgId: 77dcb763-3c46-49a8-92ab-451c7c6d47f2
                        name: IoT Department
                        parentOrgId: c6de8b2f-116a-4f89-b7c7-4aaf43c02c3e
                        children: []
                  - orgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                    name: Sales Division
                    parentOrgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    children:
                      - orgId: 2e8708f4-9ad5-4bb9-b16c-53cb5f7c1f71
                        name: Asia Region
                        parentOrgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                        children: []
                      - orgId: 95b49b55-f021-4f70-92b3-256f4a7e20a6
                        name: Europe Region
                        parentOrgId: 8b3a0a7e-05a8-4a90-861a-5e015b0e9a47
                        children: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/users/{userId}/orgs:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Retrieve all organization roles linked to the specified user
      description: |-
        Retrieve all organization roles linked to the specified user.
        **Usage**  
        `GET /users/{userId}/orgs?orgId={Guid}&orgName={string}`

        **Parameters**
        - `userId` (string, required): ID of the user.

        **Responses**
        - `200 OK`: list of organizations with associated roles for the user.
        - `403 Forbidden`: caller does not have permission to access the user.
        - `404 Not Found`: user not found.

        **Security**

        * This API requires authentication.
      parameters:
        - name: userId
          in: path
          description: 'The ID of the user. Example : 783707f1-0659-4892-a872-8f506d225d7b'
          required: true
          schema:
            type: string
            description: 'The ID of the user. Example : 783707f1-0659-4892-a872-8f506d225d7b'
        - name: orgId
          in: query
          schema:
            type: string
            format: uuid
        - name: orgName
          in: query
          schema:
            type: string
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          description: Maximum number of records to return (1–1000).
          schema:
            maximum: 1000
            minimum: 0
            type: integer
            description: Maximum number of records to return (1–1000).
            format: int32
            nullable: true
        - name: sorting
          in: query
          schema:
            type: string
        - name: filter
          in: query
          description: Fuzzy search keywords
          schema:
            type: string
            description: Fuzzy search keywords
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrgTreeDetailDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/users:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get users by organization ID
      description: >-
        Retrieve a paginated list of users belonging to a specific
        organization.  


        **Usage**  

        `GET /orgs/{orgId}/users?skipCount=0&maxResultCount=10&sorting=name
        asc`  


        **Parameters**  

        - `orgId` (Guid, required): the ID of the organization.  

        - `skipCount` (int, optional): number of records to skip.  

        - `maxResultCount` (int, optional, range 1–1000): maximum number of
        records to return.  

        - `sorting` (string, optional): sorting expression. Supported fields:
        `name`, `orgRole`, `userId`. Direction: `asc` (default) or `desc`.
        Example: `name desc`.  

        - `orgRole` (string, optional): filter by user's role within the
        organization. (`admin`, `operator`, `viewer`)

        - `name` (string, optional): filter by user's name (partial match).


        **Responses**  

        - `200 OK`: paginated list of users in the organization. 

        - `400 Bad Request`: invalid query parameters (e.g. invalid role value).

        - `404 Not Found`: organization not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: >-
            The ID of the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: name
          in: query
          description: Filter users by name (partial match)
          schema:
            type: string
            description: Filter users by name (partial match)
        - name: orgRole
          in: query
          description: Filter users by role within the organization (e.g. admin, viewer)
          schema:
            type: string
            description: Filter users by role within the organization (e.g. admin, viewer)
        - name: skipCount
          in: query
          description: Number of records to skip for pagination. Must be 0 or greater.
          schema:
            type: integer
            description: Number of records to skip for pagination. Must be 0 or greater.
            format: int32
        - name: maxResultCount
          in: query
          description: Maximum number of records to return (1–1000).
          schema:
            type: integer
            description: Maximum number of records to return (1–1000).
            format: int32
            nullable: true
        - name: sorting
          in: query
          description: 'Sorting criteria in the format: ''PropertyName ASC|DESC''.'
          schema:
            type: string
            description: 'Sorting criteria in the format: ''PropertyName ASC|DESC''.'
            nullable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgUserDeskDtoCustomPagedResultDto'
              example:
                skipCount: 0
                maxResultCount: 10
                totalPages: 1
                totalCount: 2
                items:
                  - userId: user-12345
                    orgRole: admin
                    name: Ken Huang
                    email: ken.huang@advantech.com
                    role: admin
                    orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    dateCreated: '0001-01-01T00:00:00Z'
                    dateModified: null
                  - userId: user-67890
                    orgRole: admin
                    name: An Nguyen
                    email: an.nguyen@advantech.vn
                    role: viewer
                    orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                    dateCreated: '0001-01-01T00:00:00Z'
                    dateModified: null
        '400':
          description: >-
            Invalid query parameters (e.g. invalid sorting field or pagination
            values).
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Organization not found.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    post:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Add multiple existing users to an organization
      description: >-
        Associates multiple existing users with an existing organization,
        assigning the `admin` role to each. All items are validated before any
        insertion — if any item fails, the entire batch is rejected.  


        **Usage**  

        `POST /orgs/{orgId}/users`  


        **Parameters**  

        - `orgId` (Guid, required): the ID of the organization.  

        - Request body:  
            - `input` (CreateUpdateOrgUserDtoNoOrg[], required): array of user entries, each containing:  
                - `userId` (string, required): the system GUID of the user to be added to the organization.  
                - `orgRole` (string, required): the role assigned to the user within the organization. Only `admin` is accepted.  

        **Responses**  

        - `201 Created`: all users successfully added; returns the created
        org-user list in request order.  

        - `400 Bad Request`: array is empty, any `orgRole` is not `admin`, or
        any `userId` is not a valid GUID.  

        - `403 Forbidden`: caller is not admin in the target org; or any
        `userId` is not admin in the parent org (when org has a parent).  

        - `404 Not Found`: target org not found; parent org not found; or any
        `userId` does not exist in the system.  

        - `409 Conflict`: any `userId` is already a member of the target org.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: >-
            The ID of the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateUpdateOrgUserDtoNoOrg'
            example:
              - userId: 70c00505-4678-4128-8eb5-88221ecccd75
                orgRole: admin
              - userId: 83a11614-5789-5239-9fc6-99332fddde86
                orgRole: admin
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrgUserDto'
        '400':
          description: >-
            Array is empty, any orgRole is not admin, or any userId is not a
            valid GUID.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: >-
            Caller is not admin in target org, or any userId is not admin in
            parent org.
        '404':
          description: >-
            Target org not found, parent org not found, or any userId does not
            exist in the system.
        '409':
          description: Any userId is already a member of the target org.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/users/{userId}:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get organization user by composite key
      description: >-
        Retrieve detailed information about an organization user by specifying
        both **orgId** and **userId**.  


        **Usage**  

        `GET /orgs/{orgId}/users/{userId}`  


        **Parameters**  

        - `orgId` (Guid, required): the ID of the organization.  

        - `userId` (string, required): the ID of the user within the
        organization.  


        **Responses**  

        - `200 OK`: detailed information of the organization user.  

        - `404 Not Found`: organization or user not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: >-
            The ID of the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: userId
          in: path
          description: >-
            The ID of the user within the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the user within the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgUserDeskDto'
              example:
                userId: 70c00505-4678-4128-8eb5-88221ecccd75
                orgRole: admin
                name: Ken Huang
                email: ken.huang@advantech.com
                role: SystemAdmin
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                dateCreated: '0001-01-01T00:00:00Z'
                dateModified: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Update organization user by composite key
      description: >-
        Update the details of an organization user by specifying both **orgId**
        and **userId**.  


        **Usage**  

        `Patch /orgs/{orgId}/users/{userId}`  


        **Parameters**  

        - `orgId` (Guid, required): the ID of the organization.  

        - `userId` (string, required): the ID of the user within the
        organization.  

        - Request body:  
            - `input` (UpdateOrgUserByKeyDtoNoId, required): the user information, including:  
                - `orgRole` (string, required): the role assigned to the user within the organization. (`admin`, `operator`, `viewer`)  

        **Responses**  

        - `200 OK`: updated organization user details.  

        - `404 Not Found`: organization or user not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          description: >-
            The ID of the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: userId
          in: path
          description: >-
            The ID of the user within the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the user within the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgUserByKeyDtoNoId'
            example:
              orgRole: admin
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgUserDeskDto'
              example:
                userId: 70c00505-4678-4128-8eb5-88221ecccd75
                orgRole: admin
                name: Ken Huang
                email: ken.huang@advantech.com
                role: SystemAdmin
                orgId: 70c00505-4678-4128-8eb5-88221ecccd75
                dateCreated: '0001-01-01T00:00:00Z'
                dateModified: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '409':
          description: >-
            Conflict: Cannot change the role of the last admin in the
            organization.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Delete organization user by composite key
      description: >-
        Delete an organization user by specifying both **orgId** and
        **userId**. 


        **Usage**  

        `DELETE /orgs/{orgId}/users/{userId}`  


        **Parameters**  

        - `orgId` (Guid, required): the ID of the organization.  

        - `userId` (string, required): the Desk user ID of the user to remove
        from the organization.  


        **Responses**  

        - `204 No Content`: user successfully removed from organization.
        Sub-organizations will also have the user removed.  

        - `403 Forbidden`: caller is not an admin of the organization, or caller
        is attempting to remove themselves.  

        - `404 Not Found`: organization or user not found.  

        - `409 Conflict`: cannot delete the last admin in the organization.  


        **Security**  

        This API requires authentication. Only admins of the target organization
        can remove members. An admin cannot remove their own membership.
      parameters:
        - name: orgId
          in: path
          description: >-
            The ID of the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the organization. Example :
              783707f1-0659-4892-a872-8f506d225d7b
            format: uuid
        - name: userId
          in: path
          description: >-
            The ID of the user within the organization to be deleted. Example :
            783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: >-
              The ID of the user within the organization to be deleted. Example
              : 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: >-
            Forbidden: caller is not admin in the organization, or attempted
            self-removal.
        '404':
          description: 'Not Found: organization or user not found.'
        '409':
          description: 'Conflict: Cannot delete the last admin in the organization.'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/users:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get a paginated list of users
      description: >-

        Retrieve a paginated and sorted list of application users.  


        **Usage**

        - Provide pagination parameters (`skipCount`, `maxResultCount`) to
        control result size.  

        - Provide sorting parameters (`sorting`) to order results.  


        **Parameters**

        - `skipCount` (int, optional): number of records to skip before starting
        to collect results.  

        - `maxResultCount` (int, optional): maximum number of records to return
        (1–1000).  

        - `sorting` (string, optional): field and direction to sort the results
        (e.g., "name asc", "email desc").  


        **Responses**

        - `200 OK`: successfully returns a paginated list of users.  

        - `401 Unauthorized`: caller does not have permission.  

        - `403 Forbidden`: caller does not have permission to list users.  


        **Security**

        - This API requires authentication.  

        - Available to users with appropriate roles.
      parameters:
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          description: Maximum number of records to return (1–1000).
          schema:
            maximum: 1000
            minimum: 0
            type: integer
            description: Maximum number of records to return (1–1000).
            format: int32
            nullable: true
        - name: sorting
          in: query
          schema:
            type: string
        - name: filter
          in: query
          description: Fuzzy search keywords
          schema:
            type: string
            description: Fuzzy search keywords
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppUserDisplayDtoPagedResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/users/{userId}:
    get:
      tags:
        - ___swagger_1-iam_swagger_json_Identity & Access
      summary: Get an user by ID
      description: >-

        Retrieve details of a single application user by their unique ID.  


        **Usage**

        - Provide the `userId` of the target user to fetch detailed information.


        **Parameters**

        - `userId` (Guid, required): the unique identifier of the user to
        retrieve.


        **Responses**

        - `200 OK`: successfully returns the user details.  

        - `403 Forbidden`: caller does not have permission to view this user.  

        - `404 Not Found`: the user with the specified ID does not exist.


        **Security**

        - This API requires authentication.  

        - Accessible only to users with appropriate roles.
      parameters:
        - name: userId
          in: path
          description: |-
            The ID of the user.  
                        Example : 783707f1-0659-4892-a872-8f506d225d7b
          required: true
          schema:
            type: string
            description: |-
              The ID of the user.  
                          Example : 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppUserDisplayDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/tasks/{taskId}:
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Delete a task
      description: |-
        Delete a task by its unique identifier.  
        The task can only be deleted if it is **not linked** to any batch.  

        **Usage**  
        `DELETE orgs/{orgId}/tasks/{taskId}`  

        **Parameters**  
        - `orgId` (string, required): the ID of the organization.  
        - `taskId` (Guid, required): the unique ID of the task.  

        **Responses**  
        - `204 No Content`: task deleted successfully.  
        - `404 Not Found`: task not found.  
        - `409 Conflict`: task is linked to a batch and cannot be deleted.  

        **Security**  
        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: taskId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get a task by ID
      description: >-
        Retrieve detailed information about a device task by its unique
        identifier.  


        **Usage**  

        `GET orgs/{orgId}/tasks/{taskId}`  


        **Parameters**  

        - `OrgId` (string, required): the ID of the organization the task
        belongs to.  

        - `taskId` (Guid, required): the unique ID of the task.  


        **Responses**  

        - `200 OK`: returns the task as `DeviceTaskDto`.  

        - `404 Not Found`: task not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: taskId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTaskDto'
              example:
                taskId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                name: Temperature Read Task
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cmd: ReadTemperature
                payload: '{"interval": 60, "unit": "Celsius"}'
      security:
        - oidc: []
        - Bearer: []
    put:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Update a task
      description: >-
        Update an existing device task by its unique identifier.  


        **Usage**  

        `PUT orgs/{orgId}/tasks/{taskId}`  


        **Parameters**  

        - `OrgId` (string, required): the ID of the organization the task
        belongs to.  

        - `taskId` (Guid, required): the unique ID of the task to update.  

        - `input` (CreateUpdateDeviceTaskDto, required): the task definition
        including the following properties:  
          - `Name` (string, required, max 100): Task name.  
          - `Cmd` (string, optional): the command that will be executed.  
          - `Payload` (string, optional): variables in the payload.  

        **Responses**  

        - `200 OK`: task updated successfully, returns the updated
        `DeviceTaskDto`.  

        - `404 Not Found`: task not found.  

        - `400 Bad Request`: invalid input data.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: taskId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateDeviceTaskByOrgIdDto'
            example:
              name: Set upload interval to 2000 milliseconds
              cmd: TelemetryConfiguration
              payload: >-
                {"allInterval":200,"sensors":[{"resourceId":"783707f1-0659-4892-a872-8f506d225d7b","enabled":true,"interval":null}]}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTaskDto'
              example:
                taskId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                name: Temperature Read Task
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cmd: ReadTemperature
                payload: '{"interval": 60, "unit": "Celsius"}'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/tasks:
    post:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Create a new task under an organization
      description: >-
        Create a new device task scoped to the specified organization.  


        **Usage**  

        `POST /orgs/{orgId}/tasks`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `input` (CreateUpdateDeviceTaskByOrgIdDto, required): the task
        definition, including:  
          - `Name` (string, required): the name of the task.  
          - `Cmd` (string, optional): the command to be executed.  
          - `Payload` (string, optional): variables or payload for the task execution.  

        **Responses**  

        - `201 Created`: task created successfully, returns `DeviceTaskDto`.  

        - `400 Bad Request`: invalid input.  

        - `404 Not Found`: organization not found.  

        - `409 Conflict`: task name already exists under this org.


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateDeviceTaskByOrgIdDto'
            example:
              name: Set upload interval to 2000 milliseconds
              cmd: TelemetryConfiguration
              payload: >-
                {"allInterval":200,"sensors":[{"resourceId":"783707f1-0659-4892-a872-8f506d225d7b","enabled":true,"interval":null}]}
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTaskDto'
              example:
                taskId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                name: Temperature Read Task
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cmd: ReadTemperature
                payload: '{"interval": 60, "unit": "Celsius"}'
        '400':
          description: Invalid input
        '404':
          description: Organization not found
        '409':
          description: Task name already exists
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get a paginated list of tasks by organization
      description: >-
        Retrieve a paginated list of tasks under a specific organization.  


        **Usage**  

        `GET /orgs/{orgId}/tasks?SkipCount=0&MaxResultCount=10&Sorting=Name`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `SkipCount` (int, optional): number of records to skip.  

        - `MaxResultCount` (int, optional): maximum number of records to
        return.  

        - `Sorting` (string, optional): sorting expression.  


        **Responses**  

        - `200 OK`: returns a paginated list of `DeviceTaskDto`.  

        - `404 Not Found`: organization not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: sorting
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTaskDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - taskId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                    name: Temperature Read Task
                    orgId: org-default
                    cmd: ReadTemperature
                    payload: '{"interval": 60, "unit": "Celsius"}'
                  - taskId: e4a8b7c2-6f7e-4bfe-9d2b-987654321def
                    name: Humidity Check Task
                    orgId: org-default
                    cmd: CheckHumidity
                    payload: '{"interval": 120, "unit": "%"}'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}/results:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get results of a batch
      description: >-
        Retrieve execution results for a batch under a specific organization.  


        **Usage**  

        `GET /orgs/{orgId}/batches/{batchId}/results`  


        **Path Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `batchId` (Guid, required): the ID of the batch.  


        **Query Parameters**  

        - `triggeredBy` (enum, optional): filter by trigger type. Allowed
        values: `Manual`, `Scheduler`.  

        - `triggerId` (Guid, optional): filter results by a specific trigger
        ID.  

        - `groupBy` (enum, optional): set to `trigger` to group results by
        trigger ID. Returns `Dictionary<Guid, List<BatchActionLogDto>>` when
        specified.  

        - `skipCount` (int, optional): number of records to skip for pagination.
        Default: `0`.  

        - `maxResultCount` (int, optional): maximum number of records to return.
        Range: 1–1000. Default: `10`.  

        - `sorting` (string, optional): sorting expression (e.g., `CreationTime
        DESC`).  


        **Responses**  

        - `200 OK`: returns `PagedResultDto<BatchActionLogDto>` when `groupBy`
        is not set, or `Dictionary<Guid, List<BatchActionLogDto>>` when
        `groupBy=trigger`.  

        - `400 Bad Request`: invalid query parameter (e.g. unsupported
        `triggeredBy` value).  

        - `404 Not Found`: organization or batch not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: triggeredBy
          in: query
          description: Manual, Scheduler
          schema:
            $ref: '#/components/schemas/TriggeredByType'
          example: Manual
        - name: triggerId
          in: query
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: groupBy
          in: query
          description: trigger
          schema:
            $ref: '#/components/schemas/BatchResultGroupby'
          example: trigger
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: sorting
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/BatchActionLogDto'
              example:
                totalCount: 2
                items:
                  - batchId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                    taskId: a1f9a8b1-5c6e-4aef-9f3b-987654321def
                    deviceId: 74fe488d5d35
                    sendTime: '2025-10-23T10:00:00Z'
                    sendSuccess: true
                    sendResultMessage: Command executed successfully.
                    executionResultId: 0e2c4b3a-5d6f-4a8b-b9c2-1234567890ab
                    triggerId: b4e7a1c2-2d4f-4a8c-b6d2-123456789def
                    triggeredBy: Manual
                  - batchId: d3f9a8b1-5c6e-4aef-9f3b-123456789abc
                    taskId: b7d2a9b2-7e5f-4b9c-9a8c-321654987abc
                    deviceId: 94aa218d6f72
                    sendTime: '2025-10-23T10:02:00Z'
                    sendSuccess: false
                    sendResultMessage: Device unreachable.
                    executionResultId: 5e6d8c4a-7f8e-4b1a-b3c2-abcdef123456
                    triggerId: b4e7a1c2-2d4f-4a8c-b6d2-123456789def
                    triggeredBy: Manual
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}:
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Delete a batch safely
      description: |-
        Delete a batch by ID.  

        Only batches with `IsEnabled = false` can be deleted.  

        **Usage**  
        `DELETE orgs/{orgId}/batches/{batchId}`  

        **Parameters**  
        - `batchId` (Guid, required): the ID of the batch.  

        **Responses**  
        - `204 No Content`: batch successfully deleted.  
        - `400 Bad Request`: batch is enabled and cannot be deleted.  
        - `403 Forbidden`: user not allowed to delete the batch.  
        - `404 Not Found`: batch not found.  

        **Security**  
        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '204':
          description: Batch successfully deleted
        '400':
          description: Batch is enabled or request invalid
        '403':
          description: Forbidden to delete this batch
        '404':
          description: Batch not found
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get a batch by ID
      description: >-
        Retrieve a batch by its ID.  


        **Usage**  

        `GET /orgs/{orgId}/batches/{batchId}`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `batchId` (Guid, required): the ID of the batch.  


        **Responses**  

        - `200 OK`: returns the `BatchDto`.  

        - `400 Bad Request`: invalid request (missing or malformed
        parameters).  

        - `404 Not Found`: batch not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDto'
              example:
                batchId: b9b8c9d7-8a3f-4a62-b90e-2b1dce52a7b1
                name: Daily Temperature Sync
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cronExpression: 0/15 * * * * ?*
                isEnabled: true
                runOnStartup: false
                actions:
                  - deviceId: Device-001
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b1110
                  - deviceId: Device-002
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b2222
      security:
        - oidc: []
        - Bearer: []
    put:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Update an existing batch
      description: >-
        Update an existing batch by ID.  


        **Usage**  

        `PUT orgs/{orgId}/batches/{batchId}`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `batchId` (Guid, required): the ID of the batch.  


        **Request body**  

        - `input` (CreateUpdateBatchDto, required): the batch definition,
        including name, organization, schedule, and actions.  
            - Name (string, required): the name of the batch, maximum 100 characters.  
            - OrgId (string, required): the ID of the organization the batch belongs to.  
            - CronExpression (string, required): Quartz cron expression (e.g. '0/15 * * * * ?'). 
            - IsEnabled (bool, required): whether the batch is enabled, default is true.  
            - RunOnStartup (bool, optional): whether to run the batch on application startup, default is false.  
            - Actions (List<CreateBatchActionDto>, optional): the list of actions within the batch.  
                - DeviceId (string, required): the ID of the device.  
                - TaskId (Guid, required): the ID of the task.  
                - Parameters (string, optional): the parameters for the task, default is an empty string. 

        **Responses**  

        - `200 OK`: returns the updated `BatchDto`.

        - `400 Bad Request`: validation error.

        - `404 Not Found`: batch not found.

        - `409 Conflict`: batch name already exists.


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateBatchByOrgIdDto'
            example:
              name: Example
              cronExpression: 0 0/5 * * * ?
              isEnabled: true
              runOnStartup: true
              actions:
                - deviceId: 74fe488d5d35
                  taskId: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDto'
              example:
                batchId: b9b8c9d7-8a3f-4a62-b90e-2b1dce52a7b1
                name: Daily Temperature Sync
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cronExpression: 0/15 * * * * ?*
                isEnabled: true
                runOnStartup: false
                actions:
                  - deviceId: Device-001
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b1110
                  - deviceId: Device-002
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b2222
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Update only actions of a batch
      description: >-
        Update the actions of an existing batch without changing its other
        properties.  


        **Usage**  

        `PATCH /orgs/{orgId}/batches/{batchId}`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `batchId` (Guid, required): the ID of the batch.  


        **Request body**  

        - `input` (UpdateBatchActionsDto, required): the new actions for the
        batch.  
            - Actions (List<CreateBatchActionDto>, required): the list of actions to set.  
                - DeviceId (string, required): the ID of the device.  
                - TaskId (Guid, required): the ID of the task.  
                - Parameters (string, optional): the parameters for the task, default is an empty string.  

        **Responses**  

        - `200 OK`: returns the updated `BatchDto` after successful actions
        update.  

        - `404 Not Found`: batch not found.  

        - `400 Bad Request`: invalid request format or validation failure.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBatchActionsDto'
            example:
              actions:
                - deviceId: 74fe488d5d35
                  taskId: 783707f1-0659-4892-a872-8f506d225d7b
                - deviceId: 84aa1234ccff
                  taskId: 883707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDto'
              example:
                batchId: b9b8c9d7-8a3f-4a62-b90e-2b1dce52a7b1
                name: Daily Temperature Sync
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cronExpression: 0/15 * * * * ?*
                isEnabled: true
                runOnStartup: false
                actions:
                  - deviceId: Device-001
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b1110
                  - deviceId: Device-002
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b2222
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get batch list of an Org
      description: >-
        Retrieve a paginated list of batches under a specific organization.  


        **Usage**  

        `GET /orgs/{orgId}/batches`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  

        - `taskId` (Guid, optional): filter batches by a specific task ID.  


        **Query parameters**  

        - `SkipCount` (int, optional): number of records to skip.  

        - `MaxResultCount` (int, optional): maximum number of records to
        return.  

        - `Sorting` (string, optional): sort order.  


        **Responses**  

        - `200 OK`: returns a paginated list of `BatchDto`.  

        - `400 Bad Request`: invalid parameters or validation errors.  

        - `401 Unauthorized`: authentication is required.  

        - `403 Forbidden`: insufficient permissions to access this org.  

        - `404 Not Found`: the specified org or related data not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: taskId
          in: query
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: sorting
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - batchId: a1f5f5d0-7b44-4c26-a38e-3b33b422b111
                    name: Daily Report Batch
                    orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                    cronExpression: 0/15 * * * * ?*
                    isEnabled: true
                    runOnStartup: false
                    actions:
                      - deviceId: Device-A001
                        taskId: d6c54a02-3e14-4d3a-8b83-4b4a3b8c1001
                  - batchId: b2e7e8f3-9d45-4b47-bbb3-4a88e8b56662
                    name: Weekly Backup
                    orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                    cronExpression: 0/15 * * * * ?*
                    isEnabled: true
                    runOnStartup: true
                    actions:
                      - deviceId: Server-Backup-01
                        taskId: c7a8f4d2-6b55-4f88-9a9e-2a2b7b3c4002
        '400':
          description: Invalid request parameters
        '401':
          description: Authentication is required
        '403':
          description: User does not have access to this organization
        '404':
          description: Organization or related data not found
      security:
        - oidc: []
        - Bearer: []
    post:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Create a new batch under org
      description: >-
        Create a new batch for a specific organization.  


        **Usage**  

        `POST /orgs/{orgId}/batches`  


        **Parameters**  

        - `orgId` (string, required): the ID of the organization.  


        **Request body**  

        - `input` (CreateUpdateBatchByOrgIdDto, required): the batch definition,
        including name, schedule, and actions.  
          - `orgId` (string, required): Organization ID.
          - `Name` (string, required): Batch name (max 100 characters).
          - `CronExpression` (string, required): Quartz cron expression (e.g. '0/15 * * * * ?').
          - `IsEnabled` (bool, required): Whether the batch is enabled.
          - `RunOnStartup` (bool, required): Whether to run batch on startup.
          - `Actions` (list, optional): Batch actions.

        **Responses**  

        - `201 Created`: returns the created `BatchDto`.  

        - `400 Bad Request`: invalid request (missing or invalid fields).  

        - `404 Not Found`: org not found.  

        - `409 Conflict`: batch name already exists.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateBatchByOrgIdDto'
            example:
              name: Example
              cronExpression: 0 0/5 * * * ?
              isEnabled: true
              runOnStartup: true
              actions:
                - deviceId: 74fe488d5d35
                  taskId: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '201':
          description: Returns the created BatchDto
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDto'
              example:
                batchId: b9b8c9d7-8a3f-4a62-b90e-2b1dce52a7b1
                name: Daily Temperature Sync
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cronExpression: 0/15 * * * * ?*
                isEnabled: true
                runOnStartup: false
                actions:
                  - deviceId: Device-001
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b1110
                  - deviceId: Device-002
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b2222
        '400':
          description: Invalid input (missing/invalid fields)
        '404':
          description: Org not found
        '409':
          description: Batch name already exists
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}:start:
    post:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Trigger a batch execution
      description: |-
        Trigger execution of a batch by its ID.  

        **Usage**  
        `POST orgs/{orgId}/batches/{batchId}:start`  

        **Parameters**  
        - `orgId` (string, required): the ID of the organization.  
        - `batchId` (Guid, required): the ID of the batch to trigger.  

        **Responses**  
        - `200 OK`: returns a `BatchTriggerDto` with trigger details.  
        - `404 Not Found`: batch not found.  

        **Security**  
        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchTriggerDto'
              example:
                triggerId: 9b5d9b7e-6a45-4f8a-9e62-d3f27cbb12a1
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}/triggers:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get trigger list for a batch
      description: >-
        Retrieve the list of batch trigger IDs for a specific batch.


        **Usage**  

        `GET orgs/{orgId}/batches/{batchId}/triggers`  


        **Parameters**  

        - `orgId` (string, required): the organization ID.

        - `batchId` (Guid, required): the ID of the batch.  


        **Responses**  

        - `200 OK`: returns a list of trigger IDs in `{ triggerIds: [] }`
        format. 

        - `404 Not Found`: batch not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: Returns the list of trigger IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchTriggerListResponseDto'
              example:
                triggerIds:
                  - c1c4e3b8-b750-4e9f-8916-cd5707439024
                  - 16203d4a-0f57-44fe-8c57-1f8f9d3e497b
        '404':
          description: Batch not found
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}/status:
    put:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Enable or disable an existing batch
      description: >-
        Enable or disable a batch by its ID.  


        **Usage**  

        `PUT orgs/{orgId}/batches/{batchId}/status`  


        **Parameters**  

        - `batchId` (Guid, required): the ID of the batch.  


        **Request body**  

        - `input` (UpdateBatchIsEnabledDto, required): specifies the `IsEnabled`
        status.  


        **Responses**  

        - `200 OK`: returns the updated `BatchDto`.  

        - `400 Bad Request`: invalid request (missing or invalid `isEnabled`).  

        - `403 Forbidden`: org not allowed.  

        - `404 Not Found`: batch not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBatchIsEnabledDto'
            example:
              isEnabled: false
      responses:
        '200':
          description: Returns the updated BatchDto
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDto'
              example:
                batchId: b9b8c9d7-8a3f-4a62-b90e-2b1dce52a7b1
                name: Daily Temperature Sync
                orgId: 3a1b003b-3ec1-1792-4476-1297ef0c28a5
                cronExpression: 0/15 * * * * ?*
                isEnabled: true
                runOnStartup: false
                actions:
                  - deviceId: Device-001
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b1110
                  - deviceId: Device-002
                    taskId: e4b7f0c4-2a6b-4b0a-9a3c-bb5f2a8b2222
        '400':
          description: Invalid input or missing isEnabled
        '403':
          description: Forbidden
        '404':
          description: Batch not found
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/batches/{batchId}/devices:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Batch Tasks
      summary: Get devices associated with a batch
      description: |-
        Retrieve the list of device IDs associated with a specific batch.  

        **Usage**  
        `GET /batches/{batchId}/devices`  

        **Parameters**  
        - `batchId` (Guid, required): the ID of the batch.  

        **Responses**  
        - `200 OK`: returns a list of device IDs (`List<string>`).  
        - `404 Not Found`: batch not found.  

        **Security**  
        This API requires authentication.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 783707f1-0659-4892-a872-8f506d225d7b
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BatchDevicesDto'
              example:
                deviceIds:
                  - Device-001
                  - Device-002
                  - Device-003
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/telemetry-configs:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Get device telemetry configurations
      description: Get telemetry configurations for a specific device.
      parameters:
        - name: deviceId
          in: path
          description: Device ID
          required: true
          schema:
            type: string
            description: Device ID
          example: '251547379986071552'
        - name: deviceName
          in: query
          description: Device declared name
          schema:
            type: string
            description: Device declared name
          example: MyFirstDevice
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                - enabled: true
                  deviceName: adam4612
                  sensors:
                    - name: AI_0
                      config:
                        enabled: true
                        interval: 1000
                      sensorInfo:
                        schema: double
                        displayName: Temperature Sensor
                        description: Analog input sensor for temperature measurement
                    - name: DI_0
                      config:
                        enabled: false
                        interval: 500
                      sensorInfo:
                        schema: boolean
                        displayName: Door Switch
                        description: Digital input for door open/close status
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Update device telemetry configurations
      description: >-
        Partially update telemetry configurations for a specific device.


        Returns HTTP 202 (Accepted) with the desired configuration that has been
        sent to the device.


        This does not guarantee the configuration was successfully applied.


        Use the GET endpoint to verify the actual applied configuration.
      parameters:
        - name: deviceId
          in: path
          description: Device ID
          required: true
          schema:
            type: string
            description: Device ID
          example: '251547379986071552'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SubNodeDeviceConfigForEndUserDto'
            example:
              - enabled: true
                deviceName: adam4612
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: double
                      displayName: Temperature Sensor
                      description: Analog input sensor for temperature measurement
                  - name: DI_0
                    config:
                      enabled: false
                      interval: 1500
                    sensorInfo:
                      schema: boolean
                      displayName: Door Switch
                      description: Digital input for door open/close status
              - enabled: true
                deviceName: adam6717
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 2000
                    sensorInfo:
                      schema: integer
                      displayName: Pressure Sensor
                      description: Analog input for pressure measurement
                  - name: DO_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: boolean
                      displayName: Relay Output
                      description: Digital output for relay control
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SubNodeDeviceConfigForEndUserDto'
            example:
              - enabled: true
                deviceName: adam4612
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: double
                      displayName: Temperature Sensor
                      description: Analog input sensor for temperature measurement
                  - name: DI_0
                    config:
                      enabled: false
                      interval: 1500
                    sensorInfo:
                      schema: boolean
                      displayName: Door Switch
                      description: Digital input for door open/close status
              - enabled: true
                deviceName: adam6717
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 2000
                    sensorInfo:
                      schema: integer
                      displayName: Pressure Sensor
                      description: Analog input for pressure measurement
                  - name: DO_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: boolean
                      displayName: Relay Output
                      description: Digital output for relay control
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SubNodeDeviceConfigForEndUserDto'
            example:
              - enabled: true
                deviceName: adam4612
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: double
                      displayName: Temperature Sensor
                      description: Analog input sensor for temperature measurement
                  - name: DI_0
                    config:
                      enabled: false
                      interval: 1500
                    sensorInfo:
                      schema: boolean
                      displayName: Door Switch
                      description: Digital input for door open/close status
              - enabled: true
                deviceName: adam6717
                sensors:
                  - name: AI_0
                    config:
                      enabled: true
                      interval: 2000
                    sensorInfo:
                      schema: integer
                      displayName: Pressure Sensor
                      description: Analog input for pressure measurement
                  - name: DO_0
                    config:
                      enabled: true
                      interval: 1000
                    sensorInfo:
                      schema: boolean
                      displayName: Relay Output
                      description: Digital output for relay control
      responses:
        '202':
          description: Request accepted and desired configuration sent to device
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                - enabled: true
                  deviceName: adam4612
                  sensors:
                    - name: AI_0
                      config:
                        enabled: true
                        interval: 1000
                      sensorInfo:
                        schema: double
                        displayName: Temperature Sensor
                        description: Analog input sensor for temperature measurement
                    - name: DI_0
                      config:
                        enabled: false
                        interval: 1500
                      sensorInfo:
                        schema: boolean
                        displayName: Door Switch
                        description: Digital input for door open/close status
                - enabled: true
                  deviceName: adam6717
                  sensors:
                    - name: AI_0
                      config:
                        enabled: true
                        interval: 2000
                      sensorInfo:
                        schema: integer
                        displayName: Pressure Sensor
                        description: Analog input for pressure measurement
                    - name: DO_0
                      config:
                        enabled: true
                        interval: 1000
                      sensorInfo:
                        schema: boolean
                        displayName: Relay Output
                        description: Digital output for relay control
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}:{status}:
    post:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Update device status
      description: Deactivate a device.
      parameters:
        - name: deviceId
          in: path
          description: Device id
          required: true
          schema:
            type: string
            description: Device id
          example: 74fe488d5d35
        - name: status
          in: path
          description: Device status
          required: true
          schema:
            $ref: '#/components/schemas/DeviceDeactivated'
          example: deactivate
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeSyncDeviceGetResponseDto'
              example:
                deviceId: 74fe488d5d54
                hwModel: EPC-R7300
                orgId: 5de4bd4f-bbb1-4653-95b8-239584600203
                status: Deactivated
                creationTime: '2024-01-15T10:20:30Z'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}:
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Delete a device
      description: Permanently delete device by given deviceId.
      parameters:
        - name: deviceId
          in: path
          description: Device ID
          required: true
          schema:
            type: string
            description: Device ID
          example: 74fe488d5d35
      responses:
        '204':
          description: No Content
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.3397393Z'
                    requestId: 8b1b79b9-3a88-4d42-939a-3909082aa3f2
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.3476139Z'
                    requestId: e1f7d3fe-477a-44cb-81e0-009485bfcc44
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Update a device
      description: Update device by given deviceId.
      parameters:
        - name: deviceId
          in: path
          description: Device id
          required: true
          schema:
            type: string
            description: Device id
          example: 74fe488d5d35
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdgeSyncDeviceUpdateRequestDto'
            example:
              orgId: 783707f1-0659-4892-a872-8f506d225d7b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeSyncDeviceUpdateResponseDto'
              example:
                deviceId: 74fe488d5d54
                orgId: 5de4bd4f-bbb1-4653-95b8-239584600203
                status: Activated
                hwModel: EPC_R7300
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/capabilities:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Get device hardware capabilities
      description: >-
        Retrieve the full hardware capability report of the specified device,
        including CPU, memory, disk, network interfaces, sensors, containers,
        and sub-nodes.
      parameters:
        - name: deviceId
          in: path
          description: Device MAC address or Device ID
          required: true
          schema:
            type: string
            description: Device MAC address or Device ID
          example: 74fe488d5d35
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCapResponseDto'
              example:
                cmd: getDeviceCap
                seqId: 2
                reqSeqId: null
                rspSeqId: cf58e8bd-8304-469e-80a4-934cfddeddf6
                timestamp: 1774484514
                data:
                  deviceCapsDto:
                    - creationTime: '2026-03-26T05:32:44Z'
                      groupId: eco1j
                      deviceId: EPC-R7300-001
                      data:
                        reported:
                          osName: ubuntu 24.04
                          manufacturer: NVIDIA
                          model: EPC-R7300
                          serialNumber: '1423623008565'
                          swVersion: 1.2.0
                          timestamp: '1774484514'
                          cpu:
                            numOfCores: 6
                            resourceName: deviceCPU
                            deviceResourceId: 07fe4715-d302-565d-9080-5a26ad3bda3b
                            processorArchitecture: ARM64
                            processorManufacturer: ARM
                          ram:
                            totalMemory: 7619.86
                            resourceName: deviceRAM
                            deviceResourceId: 0c88af70-048b-58c0-a8e9-012b7e92b365
                          disks:
                            - diskType: SSD
                              totalSize: 59.45
                              resourceName: /dev/nvme0n1p10
                              deviceResourceId: 39492b81-19cb-5fea-a508-cc4f68d9f38f
                          networkInterfaces:
                            - macAddress: 3a:33:de:72:29:69
                              resourceName: usb0
                              interfaceType: USB
                              deviceResourceId: 1c97412e-0e2f-5ff1-bd81-a41e306af252
                          sensors:
                            - dtmi: dtmi:advantech:EdgeSync:ContainerInfo:running;1
                              name: system-agent:running
                              resourceId: 7593453b-ee76-59c4-98b0-5eaf949ce47b
                              resourceShortId: ce47b
                              deviceResourceId: >-
                                470c611f560725a3c6d609c30cdc927a4b1f3404d71ca52d1a4ca75915d67323
                            - dtmi: dtmi:advantech:EdgeSync:CPUInfo:cpuUsage;1
                              name: deviceCPU:cpuUsage
                              resourceId: a1b2c3d4-0000-1111-2222-333344445555
                              resourceShortId: '45555'
                              deviceResourceId: 07fe4715-d302-565d-9080-5a26ad3bda3b
                          subNodes:
                            - deviceId: 74fe488d5d54
                              updatedAt: '2026-03-25T06:49:25Z'
                              deviceName: AdvantechWedaMainboardExtension
                              deviceType: systemMonitor
                          containers:
                            - image: edgesync.azurecr.io/weda-edge/system-agent:v1.0
                              resourceName: system-agent
                              containerName: system-agent
                              deviceResourceId: >-
                                470c611f560725a3c6d609c30cdc927a4b1f3404d71ca52d1a4ca75915d67323
                          mainboardExtension:
                            deviceId: 74fe488d5d54
                            updatedAt: '2026-03-26T00:21:54Z'
                            sensorCount: 42
                        desired: {}
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/custom-info:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Get custom info of a device
      description: >-
        Retrieve all custom info entries of the specified device in JSON
        key/value format.  

        Each key represents a custom property of the device.  


        **Usage**  

        `GET /devices/{deviceId}/custom-info`  


        **Parameters**  

        - `deviceId` (string, required): the ID of the device.  


        **Responses**  

        - `200 OK`: returns a dictionary of key/value pairs.  

        - `404 Not Found`: device not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: The ID of the device
          required: true
          schema:
            type: string
            description: The ID of the device
          example: 74fe488d5d35
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              example:
                deviceName: Temperature Sensor A1
                firmwareVersion: v1.2.3
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4042732Z'
                    requestId: 95c6db63-3f59-415e-8d33-0f7a96cdcf2e
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
    put:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Add or update multiple custom info entries for device
      description: >-
        Insert or update multiple custom info key/value pairs for the specified
        device.  

        New keys will be created, and existing keys will be updated with the new
        values.  


        **Usage**  

        `PUT /devices/{deviceId}/custom-info`  


        **Parameters**  

        - `deviceId` (string, required): the ID of the device.  

        - `input` (Dictionary<string, string?>, required): JSON object
        containing key/value pairs.  


        **Responses**  

        - `200 OK`: update successful.  

        - `404 Not Found`: device not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: The ID of the device
          required: true
          schema:
            type: string
            description: The ID of the device
          example: 74fe488d5d35
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
            example:
              owner: a67a9314-997b-4a14-aad7-5f5f0c523591
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceCustomInfoDto'
              example:
                deviceName: Temperature Sensor A1
                firmwareVersion: v1.2.3
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4122305Z'
                    requestId: d3297795-8776-4dff-98b2-c3b77d5ff8a5
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4119833Z'
                    requestId: ed278da9-fa2b-4fdb-a6da-0e8480ad6416
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4115369Z'
                    requestId: ce8be071-e6f3-4646-980e-91934b189374
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4123879Z'
                    requestId: 12966dea-2a03-4f56-9fa9-0ff656a3f809
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4126784Z'
                    requestId: 8dd89d46-0352-40f1-92e7-21defa1b0b67
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4125365Z'
                    requestId: a8a45463-625f-4234-932e-23333f386e50
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Delete all custom info of a device
      description: |-
        Remove all custom info entries associated with the specified device.  
        After deletion, the device will have no custom info data.  

        **Usage**  
        `DELETE /devices/{deviceId}/custom-info`  

        **Parameters**  
        - `deviceId` (string, required): the ID of the device.  

        **Responses**  
        - `204 No Content`: all custom info deleted.  
        - `404 Not Found`: device not found.  

        **Security**  
        This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: The ID of the device
          required: true
          schema:
            type: string
            description: The ID of the device
          example: 74fe488d5d35
      responses:
        '204':
          description: NoContent
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4162495Z'
                    requestId: d6f2c600-2254-4b9a-b290-6c13d8d7f74f
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/custom-info/{key}:
    patch:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Update a single custom info entry for device
      description: >-
        Update the value of a specific custom info key for the specified
        device.  

        If the key does not exist, a `404 Not Found` will be returned.  

        After update, returns all custom info entries of the device.  


        **Usage**  

        `PATCH /devices/{deviceId}/custom-info/{key}`  


        **Parameters**  

        - `deviceId` (string, required): the ID of the device.  

        - `key` (string, required): the key of the custom info entry.  

        - `input` (DeviceCustomInfoPatchDto, required): JSON object containing
        the new value.  


        **Responses**  

        - `200 OK`: update successful, returns all custom info entries.  

        - `404 Not Found`: key not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: The ID of the device
          required: true
          schema:
            type: string
            description: The ID of the device
          example: 74fe488d5d35
        - name: key
          in: path
          description: The key of the custom info entry
          required: true
          schema:
            type: string
            description: The key of the custom info entry
          example: owner
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceCustomInfoPatchDto'
            example:
              value: unknown
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceCustomInfoDto'
              example:
                - deviceId: 74fe488d5d35
                  key: owner
                  value: 26feee27-b0b3-4ab8-a1c5-9f520938fee6
                  datatype: uuid
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.424059Z'
                    requestId: 31785355-42f9-4168-8212-1d8ab0b57a7e
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Delete a single custom info entry for device
      description: >-
        Remove a specific custom info entry identified by its key for the
        specified device.  

        If the key does not exist, a `404 Not Found` will be returned.  

        After deletion, returns the remaining custom info entries of the
        device.  


        **Usage**  

        `DELETE /devices/{deviceId}/custom-info/{key}`  


        **Parameters**  

        - `deviceId` (string, required): the ID of the device.  

        - `key` (string, required): the key of the custom info entry.  


        **Responses**  

        - `200 OK`: key deleted successfully, returns remaining custom info
        entries.  

        - `404 Not Found`: key not found.  


        **Security**  

        This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: The ID of the device
          required: true
          schema:
            type: string
            description: The ID of the device
          example: 74fe488d5d35
        - name: key
          in: path
          description: The key of the custom info entry
          required: true
          schema:
            type: string
            description: The key of the custom info entry
          example: owner
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceCustomInfoDto'
              example:
                - deviceId: 74fe488d5d35
                  key: owner
                  value: 26feee27-b0b3-4ab8-a1c5-9f520938fee6
                  datatype: uuid
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4308182Z'
                    requestId: 0a840033-c067-4112-9371-4e6f13c5f96e
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Get devices with pagination
      description: Get kinds of devices. Including Weda Node and sub devices.
      parameters:
        - name: sorting
          in: query
          schema:
            type: string
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicInfoDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - subNodes:
                      - deviceId: aabbccddeeff
                        deviceName: SubNode Sensor 1
                        deviceType: sub-node
                    basicInfoId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    name: WedaNode 001
                    type: WedaNode
                    status: Activated
                    deviceId: 74fe488d5d54
                    creationTime: '2025-01-01T00:00:00Z'
                  - wedaNode:
                      deviceId: 74fe488d5d54
                      deviceName: WedaNode 001
                      deviceType: weda-node
                    basicInfoId: 4fa85f64-5717-4562-b3fc-2c963f66afb7
                    name: SubNode 001
                    type: SubNode
                    status: Activated
                    deviceId: aabbccddeeff
                    creationTime: '2025-01-01T00:00:00Z'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/devices:
    post:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Link or create Weda Node device to organization
      description: >-
        Link one existed weda node device to one organization. Or create a weda
        node device which is associated with the organization.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          example: 5bd0c9f4-3b8f-4f24-b4f5-923f5c9eda50
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdgeSyncDeviceCreateDto'
            example:
              deviceId: 74fe488d5d54
              hwModel: EPC-R7300
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeSyncDeviceDto'
              example:
                deviceId: 74fe488d5d54
                hwModel: EPC-R7300
                orgId: 5de4bd4f-bbb1-4653-95b8-239584600203
                status: Activated
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4743832Z'
                    requestId: f5cd2997-6d8e-4de6-82ac-142e058577f1
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4742181Z'
                    requestId: 073fc9c2-0948-4cb3-8352-70f8631b0bf7
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4739685Z'
                    requestId: c2c5914a-0545-495e-a4d9-d81db988ccb6
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4745337Z'
                    requestId: a7ce7a3a-88ef-4bbe-85c7-5c08408a702c
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '409':
          description: Conflict
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4748399Z'
                    requestId: 7d839428-55c3-4c2a-8855-b2a73244ab7d
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4746786Z'
                    requestId: 9e7bb156-feac-40c0-b4a2-811128056771
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Get Weda Node devices of organization
      description: >-
        This api will response paginated list of Weda Node devices belonging to
        a specific organization ID.
      parameters:
        - name: orgId
          in: path
          description: Organization ID
          required: true
          schema:
            type: string
            description: Organization ID
            format: uuid
          example: 77ffccee-4f7a-46cd-a000-8a2c254edb53
        - name: sorting
          in: query
          schema:
            type: string
          example: deviceId asc
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
          example: 0
        - name: maxResultCount
          in: query
          schema:
            type: integer
            format: int32
          example: 100
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EdgeSyncDeviceGetResponseDtoPagedResultDto
              example:
                totalCount: 1
                items:
                  - deviceId: 74fe488d5d54
                    hwModel: EPC-R7300
                    orgId: 5de4bd4f-bbb1-4653-95b8-239584600203
                    status: Activated
                    creationTime: '2024-01-15T10:20:30Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.484359Z'
                    requestId: f094e56c-aa02-4021-b63d-24ec33c06762
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4841784Z'
                    requestId: 9c97b3fc-fef4-4922-acc8-99ebc973f662
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4839063Z'
                    requestId: a12532ed-2279-4c61-a2ea-f5edb7d829d4
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4845111Z'
                    requestId: 03f81192-54f6-4580-8311-0c509872de3e
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4847977Z'
                    requestId: d93fcc2f-3dc1-4dd9-9a33-91cef04d76e4
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4846543Z'
                    requestId: 3e643dce-34e7-4f10-9242-eb2317e6af53
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
  /api/v1/orgs/{orgId}/devices/{deviceId}:
    delete:
      tags:
        - ___swagger_2-device-management_swagger_json_Devices
      summary: Remove linkage between Weda Node device and organization
      description: >-
        Remove linkage between Weda Node device and organization. Target Weda
        Node device will no longer belongs to any organization. Only system
        administrator can link target Weda Node device to other organization.
      parameters:
        - name: orgId
          in: path
          description: Organization ID
          required: true
          schema:
            type: string
            description: Organization ID
            format: uuid
          example: 77ffccee-4f7a-46cd-a000-8a2c254edb53
        - name: deviceId
          in: path
          description: Device ID
          required: true
          schema:
            type: string
            description: Device ID
          example: 74fe488d5d54
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4886914Z'
                    requestId: 78a6d6bc-78f0-4ea6-8410-a079b94d7d87
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4885142Z'
                    requestId: 857ce8a7-c8d4-40d3-ad1a-3c8c35bcc7ed
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.4890016Z'
                    requestId: 8b503fce-365b-486a-997a-fc1468bcd7ca
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteServiceErrorResponse'
              example:
                error:
                  code: Device.NotFound
                  message: The specified device does not exist.
                  details: 'DeviceId: 74fe488d-5d35-4c00-a3b9-3c2b92e4b27a'
                  data:
                    timestamp: '2026-05-22T02:55:25.488839Z'
                    requestId: 4d6bf357-2011-449e-a2fc-147f51eeeb36
                  validationErrors:
                    - message: DeviceId cannot be empty.
                      members:
                        - DeviceId
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/auth:
    get:
      tags:
        - ___swagger_2-device-management_swagger_json_WEDA Node Credentials
      summary: Get device auth info
      description: Get auth info of a device with downloadable encrypted file
      parameters:
        - name: deviceId
          in: path
          description: Device mac
          required: true
          schema:
            type: string
            description: Device mac
          example: 74fe488d5d35
        - name: type
          in: query
          description: Auth info type
          schema:
            $ref: '#/components/schemas/ProvisionServiceType'
          example: 1
        - name: enc
          in: query
          description: Encrypt or not
          schema:
            type: boolean
            description: Encrypt or not
          example: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: binary
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/docker/stacks/commands:{action}:
    post:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Commands
      summary: Manage Container State
      description: |-

        Overview: Requests a command to be executed on a device.

        • Valid actions: start, stop, resume, restart, and pause

        • Real-time execution: Sends command via NATS and waits for response

        • Command logging: Tracks command execution for audit purposes
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device.
          required: true
          schema:
            type: string
        - name: action
          in: path
          description: >-
            Container lifecycle action to execute. Valid values: start, stop,
            resume, restart, pause.
          required: true
          schema:
            $ref: '#/components/schemas/StackAction'
      requestBody:
        description: >-
          Represents a command request for container stack operations on edge
          devices.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommandRequest'
            example:
              stackConfigId: e1191d09-c5d8-4b8c-8b89-86be0e934358
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateContainerStackDto'
              example:
                deviceId: 74fe488d5d54
                seqId: 1
                reqSeqId: e09bdcb1-eef5-4bdd-b531-ef0b0daaf606
                rspSeqId: b1d0f43f-e6d1-4e9c-bdb9-ca2cc61d2c1f
                cmd: deviceCmd
                status: 0
                message: 'Stack command: stack.pause sent successfully'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#ValidationError
                title: Bad Request - Invalid request parameters
                status: 400
                detail: The field Action is invalid.
                instance: /api/v1/orgs/{orgId}/commands
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/devices/{deviceId}/docker/stacks/commands/results:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Commands
      summary: List Container State Changing Results
      description: >-

        Overview: Retrieves paginated command execution results for a specific
        device and stack.


        • Latest mode: When range is set to "latest", only the most recent
        command result is returned


        • Pagination support: Supports skip and take for result pagination


        • Sorting support: Supports sorting by ExecutedAt field (ascending or
        descending)


        • Cache-based: Results are cached in memory for 1 hour
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the device.
          required: true
          schema:
            type: string
        - name: stackConfigId
          in: query
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
        - name: range
          in: query
          description: >-
            Specifies the log range to query. If set to "latest", only the most
            recent command result is returned.

            Valid values: "all" (default) or "latest"
          schema:
            type: string
            default: all
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: |-
            Sorting expression for the results.
            The allowed values are "ExecutedAt desc" and "ExecutedAt asc".
          schema:
            type: string
            default: executedAt desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PagedResultDto  of 
                  CommandExecutionResultCacheDto
              example:
                totalCount: 1
                items:
                  - deviceId: 74fe488d5d54
                    seqId: 1
                    reqSeqId: 04ea29cc-c36e-4018-85aa-77c6159021fd
                    rspSeqId: 08463eed-28d6-4339-9829-09faf4766534
                    cmd: deviceCmd
                    data:
                      deviceCmd: stack.start
                      status: 0
                      message: stack command received
                      resultData:
                        stackId: 5f8af97c-1d67-489f-b62b-d5f4d5a965de
                      executedAt: '2025-12-01T05:39:58.871141Z'
                      completedAt: '2025-12-01T05:39:58.871141Z'
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/{stackConfigId}/revisions/{stackRevisionId}:deploy:
    post:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Deployments
      summary: Deploys container stack
      description: >-

        Overview: Deploys a container stack to multiple devices simultaneously
        with intelligent conflict resolution.


        Request body example:

        ```

        {
          "deviceIds": ["74fe488d5d54", "a1b2c3d4e5f6", "001122334455"]
        }
                    
        ```


        • Intelligent conflict resolution: Automatically determines action for
        each device:


        -- Skip: Device already has the exact same stack version deployed


        -- Update: Device has a different version of the same stack (old version
        is removed)


        -- Add: Device doesn't have this stack deployed


        • Batch processing: All devices are processed in parallel for optimal
        performance


        • Maximum count: Limited to 128 devices per batch deployment


        • Detailed reporting: Returns comprehensive statistics including total,
        skipped, and newly deployed device counts


        • Device action tracking: DeviceActions dictionary maps each device ID
        to its action (skip/update/add)


        • Order preservation: Results maintain the same order as input DeviceIds


        • Error handling: If any device deployment fails, the entire operation
        fails with detailed error message
      parameters:
        - name: stackConfigId
          in: path
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackRevisionId
          in: path
          description: Revision ID for the specified version of stack configuration.
          required: true
          schema:
            type: string
            format: uuid
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: >-
          Batch deployment configuration containing list of device IDs to deploy
          to.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateStackDeploymentsDto'
            example:
              deviceIds:
                - 74fe488d5d54
                - a1b2c3d4e5f6
                - '001122334455'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StackDeploymentsDto'
              example:
                stackDeployments:
                  - stackConfigId: 00000000-0000-0000-0000-000000000000
                    stackRevisionId: 96f8ee23-fe90-40e2-9814-76ca728b31f8
                    deploymentId: b9977159-efff-4b25-bd96-da6641882744
                    taskId: a1ea1a08-7272-4195-9ead-064dc76c334a
                    stackName: test-name
                    deviceId: 74fe488d5d54
                    version: '1'
                    status: deploying
                    containers: []
                    error: null
                    operationAction: null
                    operationStatus: null
                    reason: null
                    active: true
                    creationTime: '0001-01-01T00:00:00Z'
                totalDevices: 3
                skippedDevices: 0
                newlyDeployedDevices: 3
                deviceActions:
                  74fe488d5d54: add
                  a1b2c3d4e5f6: add
                  '001122334455': update
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#ValidationError
                title: Bad Request - Invalid request parameters
                status: 400
                detail: The field Action is invalid for DeviceIds.
                instance: /api/v1/orgs/{orgId}/stacks/{stackRevisionId}/deployments
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: >-
                  Resource Not Found. input:
                  3fa85f64-5717-4562-b3fc-2c963f66afa6
                instance: /api/v1/orgs/{orgId}/stacks/{stackRevisionId}/deployments
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/devices/{deviceId}/docker/stacks:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Deployments
      summary: List stacks in device
      description: >-

        Overview: Retrieves all deployed container stacks on a specific device.


        • Filter by stackConfigId: When `stackConfigId` is provided, returns
        only the deployment matching that stack config


        • All stacks: When `stackConfigId` is omitted or empty, returns all
        deployed stacks on the device


        • Real-time status: Response includes container runtime status (e.g.,
        running, stopped) reported by the device, not just the deployment record


        • Sorting support: Supports sorting by CreationTime (default:
        descending)


        • MaxResultCount: Maximum 1000 records per page
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device (e.g., "74fe488d5d54").
          required: true
          schema:
            type: string
        - name: stackConfigId
          in: query
          description: >-
            An unique ID for the stack configuration. If not provided, all
            stacks on the device will be return.
          schema:
            type: string
            format: uuid
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: |-
            Sorting expression for the results.
            The allowed values are "CreationTime desc" and "CreationTime asc".
          schema:
            type: string
            default: creationTime desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StackDeploymentDto'
              example:
                totalCount: 1
                items:
                  - stackConfigId: 00000000-0000-0000-0000-000000000000
                    stackRevisionId: 85d7d6f4-506c-4465-aa90-b4efccb5c313
                    deploymentId: ae080db7-c5f2-4dce-81e8-b61df65efad1
                    taskId: b8287346-ce89-4898-b91a-10b689054676
                    stackName: test-name
                    deviceId: 74fe488d5d54
                    version: '1'
                    status: running
                    containers: []
                    error: null
                    operationAction: null
                    operationStatus: null
                    reason: null
                    active: true
                    creationTime: '0001-01-01T00:00:00Z'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Forbidden
                status: 403
                detail: >-
                  No active deployment found for device 74fe488d5d51 and stack
                  1f225b34-2760-4e35-b5d5-ea81f175d861
                instance: /api/v1/orgs/{orgId}/devices/{deviceId}/deployments
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    delete:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Deployments
      summary: Remove stack from device
      description: >-

        Overview: Undeploy a specific stack deployment from a single device.


        • Single stack removal: Removes only the specified stack from the device


        • Preserve other stacks: All other stacks on the device remain unchanged


        • Active deployment only: Only removes currently active deployments


        • NATS notification: Sends updated configuration to the device


        • Database cleanup: Removes the deployment record from the database


        • Complete configuration: Device receives its complete remaining stack
        configuration
      parameters:
        - name: deviceId
          in: path
          description: ID of the device to undeploy from
          required: true
          schema:
            type: string
        - name: stackConfigId
          in: query
          description: >-
            An unique ID for the stack configuration. If not provided, all
            stacks on the device will be undeployed.
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: 'Device Not Found.DeviceId: 12312312'
                instance: /api/v1/orgs/{orgId}/deployments/{deploymentId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/deployments:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Deployments
      summary: Get stack deployments
      description: >-

        Overview: Retrieves paginated list of all active stack deployments in
        the system.


        • System-wide view: Returns deployments across all devices and stacks


        • Active only: Excludes deleted or inactive deployments


        • Administrative use: Primarily for system administrators to monitor all
        deployments


        • MaxResultCount: Maximum 1000 records per page


        • Sorting support: Supports sorting by CreationTime, with descending
        order by CreationTime as the default.
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackRevisionId
          in: query
          description: >-
            Query the deployment results by specific revision ids of container
            stack.
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: stackNames
          in: query
          description: Query the deployment results by the specific stack names.
          schema:
            type: array
            items:
              type: string
        - name: deviceIds
          in: query
          description: Query the deployment results by the targeted device ids.
          schema:
            type: array
            items:
              type: string
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: |-
            Sorting expression for the results
            Default is "CreationTime desc".
          schema:
            type: string
            default: creationTime desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateContainerStackDto'
              example:
                totalCount: 1
                items:
                  - stackConfigId: 00000000-0000-0000-0000-000000000000
                    stackRevisionId: 33c12930-6bba-4550-9176-5e764c418491
                    deploymentId: 7842472f-11d3-4986-bfd6-8f7f58d68d7d
                    taskId: 9b8b81fd-ab31-45c7-9ede-00eb6f30e8a6
                    stackName: test-name
                    deviceId: 74fe488d5d54
                    version: '1'
                    status: running
                    containers: []
                    error: null
                    operationAction: null
                    operationStatus: null
                    reason: null
                    active: true
                    creationTime: '0001-01-01T00:00:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#ValidationError
                title: Bad Request - Invalid request parameters
                status: 400
                detail: The value 'a' is not valid for StackDeploymentIds.
                instance: /api/v1/orgs/{orgId}/stacks/{stackRevisionId}/deployments
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InvalidSortDirectionError
                title: Forbidden
                status: 403
                detail: 'Invalid sort direction: ''besc''. Use ''asc'' or ''desc'''
                instance: /api/v1/orgs/{orgId}/stacks/{stackRevisionId}/deployments
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/devices/{deviceId}/stacks/deployments:
    delete:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Deployments
      summary: Clear Device Containers
      description: >-

        Overview: This operation completely removes all deployed stacks from a
        device, effectively returning it to a clean, initial state with no
        deployed containers.


        • Complete Removal: All stacks are removed from the device in one
        operation.


        • Clean Slate: The device reverts to its initial state, having no
        deployed stacks.


        • Process: The system sends an **empty stacks configuration** array to
        the device via NATS, immediately notifying the device to stop all
        containers.


        • Database Cleanup: All corresponding deployment records for the device
        are removed from the database.


        • Irreversible: Due to the nature of the reset, all stacks must be
        **redeployed individually** after this operation is complete.
      parameters:
        - name: deviceId
          in: path
          description: ID of the device to reset.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: 'Device Not Found.DeviceId: 123123123'
                instance: /api/v1/orgs/{orgId}/devices/{deviceId}/reset
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/containers/registries:
    post:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Registries
      summary: Create Registry Config
      description: >-
        <b>Overview:</b> Creates a new registry configuration with automatic
        encryption for sensitive credentials.
                    

        <b>Registry Type Requirements:</b>


        <b>• DockerHub:</b> Requires <b>username</b> and <b>accessToken</b>
        (must be provided together).
                    

        <b>• AzureACR:</b> Requires <b>username</b> and <b>userPassword</b>
        (must be provided together).
                    

        <b>• AwsECR:</b><b>region</b> is required. <b>accessKey</b> and
        <b>accessSecretKey</b> are optional, but if provided, they must be used
        together. 
                    

        <b>• Custom (e.g., Harbor):</b> All credentials are optional. If
        authentication is used, <b>username</b> and <b>userPassword</b> must be
        provided together.
                    

        <b>Please refer to the Example Value section below to view the complete
        request examples for each Registry type.</b>
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Registry creation data/configuration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRegistryDto'
            examples:
              1. DockerHub:
                value:
                  registryName: my-dockerhub
                  registryUrl: https://hub.docker.com
                  registryCredentials:
                    registryType: DockerHub
                    username: dockeruser123
                    accessToken: dckr_pat_example123456789
              2. AWS ECR:
                value:
                  registryName: my-aws-ecr
                  registryUrl: https://123456789012.dkr.ecr.ap-southeast-1.amazonaws.com
                  registryCredentials:
                    registryType: AwsECR
                    accessKey: AKIA2V7EXAMPLE123456
                    accessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                    region: ap-southeast-1
              3. Azure ACR:
                value:
                  registryName: my-azure-acr
                  registryUrl: https://myregistry.azurecr.io
                  registryCredentials:
                    registryType: AzureACR
                    username: myregistry
                    userPassword: Azure_ACR_Password_Example123
              4. Custom:
                value:
                  registryName: my-harbor
                  registryUrl: https://harbor.company.com
                  registryCredentials:
                    registryType: Custom
                    username: harbor_admin
                    userPassword: Harbor_Password_123
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryDto'
              example:
                registryId: b9d57a03-0244-488a-9a63-4ae0aedd72bd
                registryName: harbor-ecr-sync
                registryUrl: https://registry.dev.company.com
                creationTime: '2026-05-29T07:09:59.1367282Z'
                registryEncryptedCredentials:
                  registryType: AwsECR
                  encryptedAccessKey: AKIA2V7EXAMPLE123456
                  encryptedAccessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                  region: ap-southeast-1
                orgId: 898ea489-6d81-45e6-98f3-d02eaf62e5e6
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#ValidationError
                title: Bad Request - Invalid request parameters
                status: 400
                detail: The RegistryName field is required.
                instance: /api/v1/orgs/{orgId}/registries
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Registries
      summary: List Registry Configs by Organization
      description: >-

        Overview: Retrieves a paginated list of all configured registries.


        • MaxResultCount: Maximum 1000 records per page


        • Sorting support: Supports sorting by CreationTime and RegistryName,
        with descending order by CreationTime as the default.
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: >-
            Sorting expression for the results.

            The allowed values are "CreationTime desc"、"CreationTime
            asc"、"RegistryName desc"、"RegistryName asc".
          schema:
            type: string
            default: creationTime desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResultDto  of  RegistryDto'
              example:
                totalCount: 2
                items:
                  - registryId: 4f161175-3a1d-4bd7-81be-786d37755acb
                    registryName: harbor-ecr-sync
                    registryUrl: https://registry.dev.company.com
                    creationTime: '2026-05-29T07:09:59.1397381Z'
                    registryEncryptedCredentials:
                      registryType: AwsECR
                      encryptedAccessKey: AKIA2V7EXAMPLE123456
                      encryptedAccessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                      region: ap-southeast-1
                    orgId: 676821bd-261f-4bc9-a8ab-cf7cb9794dfa
                  - registryId: ef1d29e2-7af9-4d39-8a0d-1fc7df2e1c34
                    registryName: harbor-ecr-sync
                    registryUrl: https://registry.dev.company.com
                    creationTime: '2026-05-29T07:09:59.1397435Z'
                    registryEncryptedCredentials:
                      registryType: AwsECR
                      encryptedAccessKey: AKIA2V7EXAMPLE123456
                      encryptedAccessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                      region: ap-southeast-1
                    orgId: 664845e6-9048-4eaf-9748-3ee5a549d3e6
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InvalidSortDirectionError
                title: Forbidden
                status: 403
                detail: 'Invalid sort direction: ''a''. Use ''asc'' or ''desc'''
                instance: /api/v1/orgs/{orgId}/registries
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/containers/registries/{registryId}:
    put:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Registries
      summary: Update registry config
      description: >-

        Overview: Updates an existing registry configuration, applying
        validation and re-encryption to sensitive data.


        • Uniqueness Check: Throws an exception if the updated registry name
        already exists in the current deployment (excluding the registry
        currently being modified).


        • Type Validation and Requirements: Validates the specified registry
        type and requires both an access key and secret key for authentication.


        • Supported Types: The registry type must be one of **Custom**,
        **DockerHub**, **AzureACR**, or **AwsECR**.


        • Encryption: Sensitive data (such as password, access key, and secret
        key) is automatically encrypted upon update.


        • Region: The configuration allows for specifying the geographical
        region for the registry.
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: registryId
          in: path
          description: The unique ID of the registry to update.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Registry update data/configuration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRegistryDto'
            example:
              registryName: harbor-ecr-sync
              registryUrl: https://registry.dev.company.com
              registryCredentials:
                registryType: AwsECR
                accessKey: AKIA2V7EXAMPLE123456
                accessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                region: ap-southeast-1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryDto'
              example:
                registryId: c38e820d-622e-4c23-97ea-68289c5df404
                registryName: harbor-ecr-sync
                registryUrl: https://registry.dev.company.com
                creationTime: '2026-05-29T07:09:59.1477251Z'
                registryEncryptedCredentials:
                  registryType: AwsECR
                  encryptedAccessKey: AKIA2V7EXAMPLE123456
                  encryptedAccessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                  region: ap-southeast-1
                orgId: b6761398-d8d3-44c6-ac2b-a7d0ad9102e5
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#ValidationError
                title: Bad Request - Invalid request parameters
                status: 400
                detail: The RegistryUserPassword field is required.
                instance: /api/v1/orgs/{orgId}/registries/{registryId}
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ContainerMgmt:Registry:DuplicateName
                title: Forbidden
                status: 403
                detail: >-
                  Registry with name 'harbor-ecr-sync' already exists in the
                  deployment. Cannot rename registry to 'harbor-ecr-sync'
                  because another registry with this name already exists. Please
                  choose a different name.
                instance: /api/v1/orgs/{orgId}/registries/{registryId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    delete:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Registries
      summary: Delete docker registry config
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: registryId
          in: path
          description: The unique ID of the registry to delete.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: >-
                  Resource Not Found. input:
                  b34deae8-08a5-4357-b0b4-172303c3fe51
                instance: /api/v1/orgs/{orgId}/registries/{registryId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Registries
      summary: Get registry config
      description: >-

        Overview: Retrieves a specific registry configuration by its ID.


        • Exact match: Returns the registry with the exact ID


        • Sensitive data: Password and keys are encrypted and not included in
        the response
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: registryId
          in: path
          description: >-
            The unique ID of the registry to retrieve (may be referred to as
            registryId).
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryDto'
              example:
                registryId: 532abd45-8db4-487f-b680-805730b1377e
                registryName: harbor-ecr-sync
                registryUrl: https://registry.dev.company.com
                creationTime: '2026-05-29T07:09:59.1517312Z'
                registryEncryptedCredentials:
                  registryType: AwsECR
                  encryptedAccessKey: AKIA2V7EXAMPLE123456
                  encryptedAccessSecretKey: 8xJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLE7
                  region: ap-southeast-1
                orgId: b97b0dcb-cd77-45f3-adc0-32a364a2dba0
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: >-
                  Resource Not Found. input:
                  b34deae8-08a5-4357-b0b4-172303c3fe51
                instance: /api/v1/orgs/{orgId}/registries/{registryId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs:
    post:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Create container stack
      description: >-

        Overview: Creates a new container stack configuration with automatic
        version assignment.


        • Stack name must be unique and cannot duplicate the name of any
        existing stack config.


        • ComposeFileContent: Must be valid Base64 encoded Docker Compose
        content


        • Environment: Optional key-value pairs that can be referenced in Docker
        Compose files using `${VARIABLE_NAME}` syntax. Pass `null` or omit to
        skip.


        • Stack Naming Rules: Must follow Docker container naming rules:


        1. Stack name may contain lowercase letters, digits and hyphen (-)


        2. Stack name may not start or end with a hyphen (-)


        3. Stack name cannot contain consecutive hyphens (-)


        4. Maximum length of 63 characters


        Request body example:

        ```

        {
          "stackName": "my-nginx",
          "type": "compose",
          "composeFileContent": "dmVyc2lvbjogIjMuOCIKc2VydmljZXM6...",
          "environment": {
            "NGINX_PORT": "8080",
            "APP_ENV": "production",
            "REPLICAS": "3"
          },
          "description": "Production nginx stack"
        }
                    
        ```
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Container stack creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContainerStackDto'
            example:
              stackName: no-duplicate-stack-name
              type: compose
              composeFileContent: >-
                dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHR0bWw6L3Vzci9zaGFyZS9uZ2lueC9odG1s
              environment: {}
              description: this is description
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                stackConfigId: 82c6fb1e-f5ae-4071-8560-df0578473c22
                stackRevisionId: 0edd7d8a-ace1-4ca9-81e4-43d8c2501d99
                stackName: no-duplicate-stack-name
                type: compose
                composeFileContent: >-
                  dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                environment: {}
                description: this is description
                creationTime: '2026-05-29T07:09:59.1553903Z'
                orgId: dc88722d-ae42-497b-966a-ea3b2f31026e
                version: 0
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InvalidYamlContent
                title: Forbidden
                status: 403
                detail: >-
                  composeFileContent must contain valid base64 encoded YAML
                  content
                instance: /api/v1/orgs/{orgId}/stacks
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: List Stack Configs by Organization
      description: >-

        Overview: Retrieves a paginated list of container stack configurations
        with optional filtering and sorting.


        • Flexible filtering: Supports filtering by stackName, version, and type


        • Stack name filtering: When stackName is provided, filters stacks by
        exact name match


        • Version filtering: When both stackName and version are provided,
        returns specific version


        • Type filtering: When type is provided, filters stacks by exact type
        match


        • Combined filtering: All filters can be combined for precise queries


        • Results ordering: Results are returned in descending order by creation
        time by default


        • MaxResultCount: Maximum 1000 records per page


        • Sorting support: Supports sorting by creationTime and stackName, with
        descending order by CreationTime as the default.
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackName
          in: query
          description: Optional stack name filter
          schema:
            type: string
        - name: type
          in: query
          description: |-
            Optional type filter
            value : compose
          schema:
            type: string
            format: Enumeration
            default: compose
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: |-
            Sorting expression for the results
            Default is "CreationTime desc".
          schema:
            type: string
            default: creationTime desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResultDto  of  ContainerStackDto'
              example:
                totalCount: 1
                items:
                  - stackConfigId: 8594646b-44da-4163-9b12-9450a6cac003
                    stackRevisionId: 8ed70f62-51da-4a79-8fb9-98b28e81860d
                    stackName: no-duplicate-stack-name
                    type: compose
                    composeFileContent: >-
                      dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                    environment: {}
                    description: this is description
                    creationTime: '2026-05-29T07:09:59.1576601Z'
                    orgId: aac4d93e-f2c6-459e-bdda-1a83a129dd04
                    version: 0
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/{stackConfigId}/revisions/{stackRevisionId}:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Get stack revision configuration
      description: >-

        Overview: Retrieves a specific container stack configuration revision by
        its `stackRevisionId`.


        • Exact match: Filters by `orgId`, `stackConfigId`, and
        `stackRevisionId` to locate the exact revision


        • Returns 404 if no revision matches all three identifiers
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackConfigId
          in: path
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackRevisionId
          in: path
          description: Revision ID for the specified version of stack configuration.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                stackConfigId: 4fc9310f-1a1d-4e01-bd08-89fd8bc8be5a
                stackRevisionId: c0c47ae6-ad79-4c52-bdb0-ba5a44234e6b
                stackName: no-duplicate-stack-name
                type: compose
                composeFileContent: >-
                  dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                environment: {}
                description: this is description
                creationTime: '2026-05-29T07:09:59.1593684Z'
                orgId: ba222a02-1f3d-48f7-bc2d-9d27f4d800c8
                version: 0
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    delete:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Delete stack revision
      description: >-

        Overview: Deletes a specific container stack configuration revision if
        it has no active deployments.


        • Deployment check: Cannot delete stack configuration that have any
        associated deployments


        • Safety first: Must undeploy all revisions before deletion is allowed


        • Referential integrity: Prevents orphaned deployment records


        • Business exception: Throws BusinessException with stack revision ID if
        deployments exist
      parameters:
        - name: orgId
          in: path
          description: >-
            Identity of the organization that owns the stack revision to be
            deleted.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackConfigId
          in: path
          description: Unique identifier of the stack configuration to be deleted.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackRevisionId
          in: path
          description: Unique identifier of the stack revision to be deleted.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#DeleteFail
                title: Forbidden
                status: 403
                detail: >-
                  Cannot delete stack with ID
                  3fa85f64-5717-4562-b3fc-2c963f66afa6 because it has associated
                  deployments.
                instance: >-
                  /api/v1/orgs/{orgId}/stacks/{stackConfigId}/revisions/{stackRevisionId}
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: >-
                  Resource Not Found. input:
                  3fa85f64-5717-4562-b3fc-2c963f66afa6
                instance: >-
                  /api/v1/orgs/{orgId}/stacks/{stackConfigId}/revisions/{stackRevisionId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/revisions/diff:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Compare Stack Revisions
      description: >-

        Overview: Compare two container stack configurations revisions and
        return their differences.


        • Git-like Diff: The output provides a detailed comparison similar to a
        standard git diff tool.


        • Field-level Analysis: Compares all stack properties, including
        metadata.


        • Environment Variables: Includes a detailed comparison of environment
        configurations.


        • Compose Content Deep Dive: Compares the decoded Docker Compose file
        content (Base64 decoded).
      parameters:
        - name: orgId
          in: path
          description: >-
            Identity of the organization that owns the stack revision to be
            compared.
          required: true
          schema:
            type: string
            format: uuid
        - name: sourceStackRevisionId
          in: query
          description: Unique identifier of the stack revision to compare from
          required: true
          schema:
            type: string
            format: uuid
        - name: targetStackRevisionId
          in: query
          description: Unique identifier of the stack revision to compare to
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                sourceStack:
                  stackConfigId: 2cea6c7b-eebb-4c2b-847a-5ceeaa787e4b
                  stackRevisionId: 6da5cc60-5061-463e-8d27-45f9046e6e2d
                  stackName: no-duplicate-stack-name
                  type: compose
                  composeFileContent: >-
                    dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                  environment: {}
                  description: this is description
                  creationTime: '2026-05-29T07:09:59.1638895Z'
                  orgId: 0e4e0395-130b-4bea-9bd7-a88287bfb852
                  version: 0
                targetStack:
                  stackConfigId: 40fcb57c-e50c-47a6-9fef-b9c76def0813
                  stackRevisionId: e2ed35cd-6ef5-4540-9ffa-2fb00eddf206
                  stackName: no-duplicate-stack-name
                  type: compose
                  composeFileContent: >-
                    dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                  environment: {}
                  description: this is description 2
                  creationTime: '2026-05-29T07:09:59.163894Z'
                  orgId: c3b1ee37-d678-4644-9335-877c4422b743
                  version: 0
                fieldDifferences:
                  - fieldName: Description
                    sourceValue: this is description
                    targetValue: this is description 2
                    changeType: modified
                environmentDiff:
                  addedVariables: {}
                  removedVariables: {}
                  changedVariables: {}
                yamlDiff:
                  addedFields: []
                  removedFields: []
                  modifiedFields: []
                  errors: []
                  hasChanges: false
                  summary: No changes in YAML content
                areIdentical: false
                summary: 2 field(s) modified
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/{stackConfigId}:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Get latest container stack configuration
      description: >-

        Overview: Retrieves the latest revision of a specific container stack
        configuration.


        • Exact match: Returns the stack configuration with the exact
        StackConfigId


        • Latest revision: Returns the latest revision of the stack
        configuration
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackConfigId
          in: path
          description: StackConfigId of the stack to retrieve
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                stackConfigId: 9d7ebeb8-6345-4b84-a29d-d56b40db471f
                stackRevisionId: fe2f03cb-a716-4866-bca1-3de71f41cce4
                stackName: no-duplicate-stack-name
                type: compose
                composeFileContent: >-
                  dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                environment: {}
                description: this is description
                creationTime: '2026-05-29T07:09:59.1656929Z'
                orgId: 29f4160c-7b2d-41df-ab60-9b276b08ebb2
                version: 0
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    delete:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Delete stack
      description: >-

        Overview: Deletes a container stack configuration and all its revisions
        if they have no active deployments.


        • Deployment check: Cannot delete stack configuration that have any
        associated deployments
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackConfigId
          in: path
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: https://learn.advantech.com/WEDA/api/errorcode#DeleteFail
                title: Forbidden
                status: 403
                detail: >-
                  Cannot delete stack with ID
                  3fa85f64-5717-4562-b3fc-2c963f66afa6 because it has associated
                  deployments.
                instance: /api/v1/orgs/{orgId}/stacks/{stackConfigId}
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#ResourceNotFound
                title: Resource Not Found
                status: 404
                detail: >-
                  Resource Not Found. input:
                  3fa85f64-5717-4562-b3fc-2c963f66afa6
                instance: /api/v1/orgs/{orgId}/stacks/{stackConfigId}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
    patch:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: Update Stack Revision
      description: >-

        Overview: Updates an existing container stack configuration by creating
        a new revision.


        • Active deployments: Existing deployments will NOT be affected by the
        update.


        • Partial update: Only fields with non-null values will be updated.
        Fields that are not included or explicitly set to null will be ignored.
      parameters:
        - name: orgId
          in: path
          description: Identity for user's organization.
          required: true
          schema:
            type: string
            format: uuid
        - name: stackConfigId
          in: path
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Updated container stack configuration data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStackDto'
            example:
              composeFileContent: >-
                dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
              environment: {}
              description: this is description
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                stackConfigId: 18f47684-4815-4897-b367-dbd9c6386598
                stackRevisionId: 98640d93-1428-426c-bd8d-7ee37aa93592
                stackName: no-duplicate-stack-name
                type: compose
                composeFileContent: >-
                  dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                environment: {}
                description: this is description
                creationTime: '2026-05-29T07:09:59.1713106Z'
                orgId: 24af2eaf-7006-4086-ae3a-d5f85c2aeb3f
                version: 0
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                code: InvalidYamlContent
                message: >-
                  composeFileContent must contain valid base64 encoded YAML
                  content
                details: null
                data: null
                validationErrors: null
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/orgs/{orgId}/stack-configs/{stackConfigId}/revisions:
    get:
      tags:
        - ___swagger_4-container-management_swagger_json_Container Stacks
      summary: List stack revisions
      description: >-

        Overview: Retrieves all revisions of a specific container stack
        configuration.


        • Exact match: Returns the stack configuration with the exact stack
        config ID
      parameters:
        - name: stackConfigId
          in: path
          description: An unique ID for the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: |-
            Sorting expression for the results.
            The allowed values are "CreationTime desc" and "CreationTime asc".
          schema:
            type: string
            default: CreationTime desc
        - name: orgId
          in: path
          description: Identity of the organization that owns the stack configuration.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerStackDto'
              example:
                totalCount: 1
                items:
                  - stackConfigId: 05bbb4d2-437b-4dc8-9de3-62ea31aaf58f
                    stackRevisionId: d1022e84-5f66-4009-8722-0ddc76586823
                    stackName: no-duplicate-stack-name
                    type: compose
                    composeFileContent: >-
                      dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw
                    environment: {}
                    description: this is description
                    creationTime: '2026-05-29T07:09:59.1748153Z'
                    orgId: 3b078d44-4f38-437b-9650-0f7468942417
                    version: 0
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                type: >-
                  https://learn.advantech.com/WEDA/api/errorcode#InternalServerError
                title: Internal Server Error
                status: 500
                detail: An internal error occurred during your request!
      security:
        - Bearer: []
  /api/v1/notifications/channels:
    post:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Create channel
      description: >-
        Create a new notification channel with configuration.


        **Request Body**


        * `name` (string, required): Channel name. Max length: 100. Must not
        contain whitespace.

        * `channelType` (enum, required): Channel type. Valid values: `email`,
        `teams`, `linemessage`, `webhook`.

        * `description` (string, optional): Channel description. Max length:
        500.

        * `isEnabled` (boolean, optional): Whether the channel is active.
        Default: `true`.

        * `commonSettings` (object, optional): Common settings including
        `timeout`, `retryAttempts`, `retryDelay`.

        * `config` (object, required): Channel-type-specific configuration (see
        per-type structure below).

        * `templateId` (string, optional): Template identifier associated with
        this channel.

        * `recipients` (array, optional): Default recipients for this channel.

        * `tags` (array, optional): Tags for categorization.


        **Config Structure by channelType**


        | channelType | Required Fields | Optional Fields |

        |---|---|---|

        | `email` | `host`, `port` (1-65535), `username`, `password`,
        `senderEmail` (email format) | `senderName`, `secure` |

        | `teams` | `url` (URL format) | - |

        | `linemessage` | `accessToken`, `sendMode` (`push` or `multicast`) | -
        |

        | `webhook` | `url` (URL format), `method`
        (`GET`/`POST`/`PUT`/`DELETE`), `contentType`
        (`applicationJson`/`applicationFormUrlEncoded`/`textPlain`) | - |


        **Recipients Validation (email channel)**


        * `target`: must be valid email format

        * `type`: must be `to` or `cc`


        **Responses**


        * `201 Created`: Channel created successfully.

        * `400 Bad Request`: Validation error.

        * `409 Conflict`: Channel with same name already exists.

        * `404 Not Found`: Channel type not found.

        * `503 Service Unavailable`: Channel validation failed.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChannelDto'
            examples:
              Email Channel:
                value:
                  name: company-email-alert
                  channelType: email
                  description: 公司通知信件通道
                  isEnabled: true
                  commonSettings:
                    timeout: 30
                    retryAttempts: 3
                    retryDelay: 1000
                  config:
                    host: smtp.gmail.com
                    port: 465
                    username: your_account@gmail.com
                    password: your_app_password
                    senderEmail: no-reply@your-company.com
                    senderName: 通知系統
                    secure: true
                  recipients:
                    - name: 管理員
                      target: admin@example.com
                      type: to
                    - name: 主管
                      target: manager@example.com
                      type: cc
                  tags:
                    - notification
                    - email
              Teams Channel:
                value:
                  name: Dev-Team-Notification
                  channelType: teams
                  description: 用於開發團隊系統通知的 Teams 頻道
                  isEnabled: true
                  commonSettings:
                    timeout: 30
                    retryAttempts: 3
                    retryDelay: 1000
                  config:
                    url: >-
                      https://your-tenant.logic.azure.com:443/workflows/your-workflow-id/triggers/manual/paths/invoke
              LINE Message Channel:
                value:
                  name: LINE_Push_Channel
                  channelType: linemessage
                  description: null
                  isEnabled: true
                  commonSettings:
                    timeout: 30
                    retryAttempts: 1
                    retryDelay: 1000
                  config:
                    accessToken: <your LINE Channel Access Token>
                    sendMode: push
                  recipients:
                    - name: Morris
                      target: <LINE userId>
                  tags:
                    - line
                    - push
              Webhook Channel:
                value:
                  name: qa-webhook-basic
                  channelType: webhook
                  description: null
                  isEnabled: true
                  commonSettings:
                    timeout: 30
                    retryAttempts: 3
                    retryDelay: 1000
                  config:
                    url: https://webhook.site/bcd0ae88-19bd-421b-b525-98a305727032
                    method: POST
                    contentType: applicationJson
                  templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                  recipients:
                    - name: QA Webhook Endpoint
                      target: >-
                        https://webhook.site/bcd0ae88-19bd-421b-b525-98a305727032
                      type: to
                  tags:
                    - webhook
                    - qa
      responses:
        '201':
          description: Channel created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelDetailDto'
              example:
                channelId: channel_abc12345-6789-0abc-def0-123456789abc
                name: EmailChannel
                channelType: email
                description: System notification email channel
                isEnabled: true
                commonSettings:
                  timeout: 5000
                  retryAttempts: 3
                  retryDelay: 1000
                config:
                  host: smtp.example.com
                  port: 587
                  username: noreply@example.com
                  senderEmail: noreply@example.com
                  secure: true
                recipients: []
                tags: []
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                createdAt: '2026-05-21T10:18:39.2266864Z'
                updatedAt: '2026-05-21T10:18:39.2266865Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyRequire
                title: Bad Request
                status: 400
                detail: The property 'channelName' is required.
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: Channel type 'invalid-type' not found
                instance: /notification/channels/registry-info/types/invalid-type
        '409':
          description: Conflict
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.AlreadyExists
                title: Conflict
                status: 409
                detail: Channel with name 'MyChannel' already exists
                instance: /notification/channels
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Notification.Channel.ConnectionFailed
                title: Service Unavailable
                status: 503
                detail: Failed to validate channel configuration
                instance: /notification/channels
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: List channels
      description: >-
        List all channels with optional filtering and pagination.


        **Parameters**


        * `skipCount` (integer, optional, default: 0): Number of records to skip

        * `maxResultCount` (integer, optional, default: 20, max: 100): Maximum
        records to return

        * `channelType` (string, optional): Filter by channel type

        * `isEnabled` (boolean, optional): Filter by enabled status


        **Responses**


        * `200 OK`: Channels retrieved successfully.

        * `400 Bad Request`: Invalid pagination parameters.
      parameters:
        - name: channelType
          in: query
          schema:
            type: string
        - name: isEnabled
          in: query
          schema:
            type: boolean
        - name: name
          in: query
          schema:
            type: string
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: Channels retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelListItemDtoPagedResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/channels/{channelId}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Get channel
      description: >-
        Retrieve detailed information for a specific channel.


        **Parameters**


        * `channelId` (string, required): Channel identifier (format:
        channel_xxx)


        **Responses**


        * `200 OK`: Channel details retrieved successfully.

        * `404 Not Found`: Channel not found.

        * `400 Bad Request`: Invalid channel ID format.
      parameters:
        - name: channelId
          in: path
          description: 'Channel identifier (format: channel_xxx)'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Channel retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelDetailDto'
              example:
                channelId: channel_abc12345-6789-0abc-def0-123456789abc
                name: EmailChannel
                channelType: email
                description: System notification email channel
                isEnabled: true
                commonSettings:
                  timeout: 5000
                  retryAttempts: 3
                  retryDelay: 1000
                config:
                  host: smtp.example.com
                  port: 587
                  username: noreply@example.com
                  senderEmail: noreply@example.com
                  secure: true
                recipients: []
                tags: []
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                createdAt: '2026-05-21T10:18:39.245239Z'
                updatedAt: '2026-05-21T10:18:39.2452391Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Resource with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Update channel
      description: >-
        Update channel configuration (partial update supported).


        **Parameters**


        * `channelId` (string, required): Channel identifier (format:
        channel_xxx)


        **Request Body**


        All fields are optional. Only provided fields will be updated.


        * `name` (string): Channel name.

        * `channelType` (enum): Valid values: `email`, `teams`, `linemessage`,
        `webhook`.

        * `description` (string): Channel description.

        * `isEnabled` (boolean): Enable or disable the channel.

        * `commonSettings` (object): `timeout`, `retryAttempts`, `retryDelay`.

        * `config` (object): Channel-type-specific configuration (same structure
        as create).

        * `templateId` (string): Template identifier.

        * `recipients` (array): Default recipients.

        * `tags` (array): Tags for categorization.


        **Responses**


        * `200 OK`: Channel updated successfully.

        * `404 Not Found`: Channel not found.

        * `400 Bad Request`: Validation error.

        * `503 Service Unavailable`: Channel validation failed.
      parameters:
        - name: channelId
          in: path
          description: 'Channel identifier (format: channel_xxx)'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChannelDto'
            example:
              name: UpdatedEmailChannel
              channelType: null
              description: Updated system notification email channel
              isEnabled: false
              commonSettings:
                timeout: 10000
                retryAttempts: 5
                retryDelay: 2000
              config:
                host: smtp-new.example.com
                port: 465
                username: noreply@example.com
                password: new-password
                senderEmail: noreply@example.com
                senderName: null
                secure: true
              templateId: null
              recipients:
                - name: 管理員
                  target: admin@example.com
                  type: to
              tags:
                - notification
                - email
      responses:
        '200':
          description: Channel updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelDetailDto'
              example:
                channelId: channel_abc12345-6789-0abc-def0-123456789abc
                name: EmailChannel
                channelType: email
                description: System notification email channel
                isEnabled: true
                commonSettings:
                  timeout: 5000
                  retryAttempts: 3
                  retryDelay: 1000
                config:
                  host: smtp.example.com
                  port: 587
                  username: noreply@example.com
                  senderEmail: noreply@example.com
                  secure: true
                recipients: []
                tags: []
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                createdAt: '2026-05-21T10:18:39.2684998Z'
                updatedAt: '2026-05-21T10:18:39.2685Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: Invalid format for property 'config'
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Resource with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Notification.Channel.ConnectionFailed
                title: Service Unavailable
                status: 503
                detail: Failed to validate channel configuration
                instance: /notification/channels
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Delete channel
      description: >-
        Delete a channel permanently.


        **Parameters**


        * `channelId` (string, required): Channel identifier (format:
        channel_xxx)


        **Responses**


        * `204 No Content`: Channel deleted successfully.

        * `404 Not Found`: Channel not found.

        * `400 Bad Request`: Invalid channel ID format.
      parameters:
        - name: channelId
          in: path
          description: 'Channel identifier (format: channel_xxx)'
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Channel deleted successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Resource with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/channels/{channelId}/status:
    put:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Enable/Disable channel
      description: >-
        Toggle channel enabled status.


        **Parameters**


        * `channelId` (string, required): Channel identifier (format:
        channel_xxx)


        **Request Body**


        * `isEnabled` (boolean, required): true to enable, false to disable


        **Responses**


        * `200 OK`: Channel status updated successfully.

        * `404 Not Found`: Channel not found.

        * `400 Bad Request`: Invalid parameters.
      parameters:
        - name: channelId
          in: path
          description: 'Channel identifier (format: channel_xxx)'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChannelUpdateStatusRequest'
            example:
              isEnabled: true
      responses:
        '200':
          description: Channel status updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelStatusResponseDto'
              example:
                channelId: channel_abc12345-6789-0abc-def0-123456789abc
                isEnabled: true
                updatedAt: '2026-05-21T10:18:39.2804Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Resource with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/channels/registry-info/types:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: List available channel types
      description: >-
        Retrieve all available channel types and their status.


        **Parameters**


        None


        **Responses**


        * `200 OK`: Returns a list of available channel types with their status
        and configuration information.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelTypeDtoPagedResultDto'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/channels/registry-info/types/{channelType}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Get channel type info
      description: >-
        Get detailed configuration schema for a specific channel type.


        **Parameters**


        * `channelType` (enum, required): Channel type identifier (e.g.,
        'email', 'teamplus')


        **Responses**


        * `200 OK`: Returns detailed channel type configuration schema.

        * `404 Not Found`: Channel type not found.

        * `400 Bad Request`: Invalid channel type format.
      parameters:
        - name: channelType
          in: path
          description: Channel type identifier (e.g., 'email', 'teamplus')
          required: true
          schema:
            $ref: '#/components/schemas/ChannelType'
      responses:
        '200':
          description: Channel type info retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelTypeDetailDto'
              example:
                configSchema:
                  type: object
                  properties:
                    host:
                      type: string
                      description: SMTP server host
                    port:
                      type: integer
                      default: 587
                    username:
                      type: string
                    password:
                      type: string
                      format: password
                    senderEmail:
                      type: string
                      format: email
                    secure:
                      type: boolean
                      default: true
                  required:
                    - host
                    - username
                    - password
                    - senderEmail
                examples:
                  - host: smtp.gmail.com
                    port: 587
                    username: notifications@example.com
                    password: app-password-here
                    senderEmail: notifications@example.com
                    secure: true
                channelType: email
                name: Email
                description: Send emails via SMTP
                status: loaded
                version: 2.0.0
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.FormatError
                title: Bad Request
                status: 400
                detail: Data validation failed
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Resource with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/channels/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/transfer-functions:
    post:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Create transfer function
      description: >-
        Create a new transfer function to transform data object values using
        mathematical expressions.


        **Path Parameters**


        * `deviceId` (string, required): Device identifier. The device must
        exist in the system. Example: `9f75abda56c3`


        **Request Body Parameters**


        * `type` (FunctionTransferType, required): Type of transfer function.
        Currently only `Expression` is supported. Example: `Expression`

        * `dataObjectName` (string, required): Output data object name for the
        transformed value. Must be unique for the device. Accepted formats:
        camelCase, snake_case, or single word. No all-digit names or special
        characters. Example: `calibrated_temperature`

        * `expression` (string, required): Mathematical expression used for the
        transformation function. Supports basic arithmetic operators (+, -, *,
        /, %). Variables used in the expression must be defined in the device
        hardware capabilities. Example: `(temperature * 1.8) + 32`


        **Responses**


        * `200 OK`: Returns the created transfer function. Response fields:
          - `transferFunctionId`: Unique identifier (GUID string)
          - `type`: Transfer type (`expression`)
          - `dataObjectName`: Output data object name
          - `expression`: Mathematical expression
          - `isEnabled`: Whether the transfer function is active (always `true` on creation)
          - `creationTime`: ISO 8601 creation timestamp
          - `lastModificationTime`: ISO 8601 last update timestamp (null on creation)
        * `400 Bad Request`: Invalid request parameters or expression syntax.

        * `409 Conflict`: Transfer function already exists for the device and
        output name combination.


        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: 'Device identifier. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunctionTransferCreateRequest'
            example:
              dataObjectName: calibrated_temperature
              expression: (temperature * 1.8) + 32
              type: Expression
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTransferDto'
              example:
                transferFunctionId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                type: expression
                dataObjectName: calibrated_temperature
                expression: (temperature * 1.8) + 32
                isEnabled: true
                creationTime: '2026-02-06T08:30:00Z'
                lastModificationTime: '2026-02-06T08:35:00Z'
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Get transfer functions with pagination
      description: >-
        Retrieve a paginated list of transfer functions for a specific device.


        **Query Parameters**


        * `keyword` (string, optional): Fuzzy search keyword for filtering
        results. Searches across `outputDataObjectName` field. Supports multiple
        keywords separated by comma (e.g., `temp,voltage`). The search is
        case-sensitive and performs partial matching (contains operation).

        * `skipCount` (integer, optional): Number of items to skip for
        pagination. Used for calculating which page to retrieve. Default: `0`.
        Example: For page 2 with 10 items per page, set `skipCount=10`.

        * `maxResultCount` (integer, optional): Maximum number of items to
        return per page. Controls page size. Default: `10`. Maximum allowed:
        `100`.

        * `sorting` (string, optional): Sorting criteria using format `FieldName
        [ASC|DESC]`. Supports multiple fields separated by comma for multi-level
        sorting.
          - Available fields: `DataObjectName`, `Type`, `CreationTime`, `LastModificationTime`
          - Default: `CreationTime ASC`
          - Examples: 
            - `CreationTime DESC` - Sort by creation time, newest first
            - `DataObjectName ASC, CreationTime DESC` - Sort by output name ascending, then by creation time descending
        **Responses**


        * `200 OK`: Returns a paginated result containing:
          - `totalCount`: Total number of transfer functions matching the filter criteria
          - `items`: Array of transfer function objects for the current page

        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: >-
            Device identifier to filter transfer functions. Example:
            `9f75abda56c3`
          required: true
          schema:
            type: string
        - name: keyword
          in: query
          schema:
            type: string
        - name: sorting
          in: query
          schema:
            type: string
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTransferDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - transferFunctionId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                    type: expression
                    dataObjectName: calibrated_temperature
                    expression: (x * 1.8) + 32
                    isEnabled: false
                    creationTime: '2026-02-06T08:30:00Z'
                    lastModificationTime: '2026-02-06T08:35:00Z'
                  - transferFunctionId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                    type: expression
                    dataObjectName: adjusted_pressure
                    expression: x * 1.01325
                    isEnabled: false
                    creationTime: '2026-02-06T09:00:00Z'
                    lastModificationTime: null
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/transfer-functions/{transferFunctionId}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Get transfer function by ID
      description: >-
        Retrieve detailed information of a specific transfer function.


        **Path Parameters**


        * `deviceId` (string, required): Device identifier. Example:
        `9f75abda56c3`

        * `transferFunctionId` (string, required): Unique identifier of the
        transfer function in GUID format. Example:
        `3f2504e0-4f89-11d3-9a0c-0305e82c3301`


        **Responses**


        * `200 OK`: Returns the transfer function object with fields:
          - `transferFunctionId`: Unique identifier (GUID string)
          - `type`: Transfer type (`expression`)
          - `dataObjectName`: Output data object name
          - `expression`: Mathematical expression
          - `isEnabled`: Whether the transfer function is active
          - `creationTime`: ISO 8601 creation timestamp
          - `lastModificationTime`: ISO 8601 last update timestamp
        * `404 Not Found`: Transfer function with the specified ID does not
        exist for this device.


        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: 'Device identifier. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: transferFunctionId
          in: path
          description: >-
            Transfer function unique identifier in GUID format. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTransferDto'
              example:
                transferFunctionId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                type: expression
                dataObjectName: calibrated_temperature
                expression: (temperature * 1.8) + 32
                isEnabled: true
                creationTime: '2026-02-06T08:30:00Z'
                lastModificationTime: '2026-02-06T08:35:00Z'
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Update transfer function
      description: >-
        Update an existing transfer function's expression, type, or enabled
        status. All fields are optional; only provided fields are updated.


        **Path Parameters**


        * `deviceId` (string, required): Device identifier. Example:
        `9f75abda56c3`

        * `transferFunctionId` (string, required): Unique identifier of the
        transfer function to update. Example:
        `3f2504e0-4f89-11d3-9a0c-0305e82c3301`


        **Request Body Parameters** (all optional)


        * `type` (FunctionTransferType, optional): Type of transfer function.
        Example: `Expression`

        * `expression` (string, optional): New mathematical expression for
        transformation. Example: `((x * 9) / 5) + 32`

        * `isEnabled` (boolean, optional): Enable or disable the transfer
        function. Example: `true`


        **Responses**


        * `200 OK`: Returns the updated transfer function object with updated
        `lastModificationTime`.

        * `404 Not Found`: Transfer function with the specified ID does not
        exist.


        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: 'Device identifier. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: transferFunctionId
          in: path
          description: >-
            Transfer function unique identifier to update. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: >-
          transfer function update request containing new output name and
          expression
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateRequest'
            example:
              expression: ((x * 9) / 5) + 32
              type: Expression
              isEnabled: null
          text/json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateRequest'
            example:
              expression: ((x * 9) / 5) + 32
              type: Expression
              isEnabled: null
          application/*+json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateRequest'
            example:
              expression: ((x * 9) / 5) + 32
              type: Expression
              isEnabled: null
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTransferDto'
              example:
                transferFunctionId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                type: expression
                dataObjectName: calibrated_temperature
                expression: (temperature * 1.8) + 32
                isEnabled: true
                creationTime: '2026-02-06T08:30:00Z'
                lastModificationTime: '2026-02-06T08:35:00Z'
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Delete transfer function
      description: >-
        Delete a transfer function by its ID. This is a soft delete operation.


        **Path Parameters**


        * `deviceId` (string, required): Device identifier. Example:
        `9f75abda56c3`

        * `transferFunctionId` (string, required): Unique identifier of the
        transfer function to delete. Example:
        `3f2504e0-4f89-11d3-9a0c-0305e82c3301`


        **Responses**


        * `204 No Content`: transfer function was successfully deleted. No
        response body is returned.

        * `404 Not Found`: Transfer function with the specified ID does not
        exist for this device.


        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: 'Device identifier. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: transferFunctionId
          in: path
          description: >-
            Transfer function unique identifier to delete. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/transfer-functions/{transferFunctionId}/status:
    patch:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Update transfer function status
      description: >-
        Enable or disable a transfer function without modifying its
        configuration.


        **Path Parameters**


        * `deviceId` (string, required): Device identifier. Example:
        `9f75abda56c3`

        * `transferFunctionId` (string, required): Unique identifier of the
        transfer function. Example: `3f2504e0-4f89-11d3-9a0c-0305e82c3301`


        **Request Body Parameters**


        * `isEnabled` (boolean, required): Enable or disable the transfer
        function. Example: `true`


        **Responses**


        * `200 OK`: Returns the updated transfer function object with new
        status.

        * `404 Not Found`: transfer function with the specified ID does not
        exist.


        **Security**


        * This API requires authentication.
      parameters:
        - name: deviceId
          in: path
          description: 'Device identifier. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: transferFunctionId
          in: path
          description: >-
            transfer function unique identifier. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: transfer function status update request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateStatusRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateStatusRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/FunctionTransferUpdateStatusRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionTransferDto'
              example:
                transferFunctionId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                type: expression
                dataObjectName: calibrated_temperature
                expression: (temperature * 1.8) + 32
                isEnabled: true
                creationTime: '2026-02-06T08:30:00Z'
                lastModificationTime: '2026-02-06T08:35:00Z'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/messages/{messageId}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Get message status
      description: |-
        Get message delivery status and details.

        **Parameters**

        * `messageId` (string, required): Message identifier (format: msg_xxx)

        **Responses**

        * `200 OK`: Message status retrieved successfully.
        * `404 Not Found`: Message not found.
        * `400 Bad Request`: Invalid message ID format.

        **Status Values**: `pending`, `sent`, `failed`, `partial`, `success`
      parameters:
        - name: messageId
          in: path
          description: 'Message identifier (format: msg_xxx)'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Message status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDetailDto'
              example:
                messageId: msg_abc12345-6789-0abc-def0-123456789abc
                channelIds:
                  - channel_abc12345-6789-0abc-def0-123456789abc
                templateId: tmpl_abc12345
                recipients:
                  - name: null
                    target: user@example.com
                    type: to
                subject: Welcome
                content: Dear user, welcome to join us！
                variables:
                  userName: user
                status: success
                results:
                  - channelId: channel_abc12345-6789-0abc-def0-123456789abc
                    name: Production Email
                    status: success
                    message: Message sent successfully
                    sentAt: '2026-05-21T10:18:39.3970516Z'
                successCount: 1
                failureCount: 0
                totalCount: 1
                settings:
                  timeout: 30
                  retryAttempts: 3
                  retryDelay: 1000
                attachments:
                  - filename: report.pdf
                    contentType: application/pdf
                sentAt: '2026-05-21T10:18:39.3970529Z'
                createdAt: '2026-05-21T10:18:39.3970531Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Message with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/messages/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/messages:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: List messages
      description: >-

        List message records with filtering and pagination. All query parameters
        are optional and may be combined. When multiple parameters are provided,
        filters are combined using logical AND. Common usage patterns include
        createdAtStart/createdAtEnd and sentAtStart/sentAtEnd, but any
        combination is supported.


        **Parameters**


        * `skipCount` (integer, optional, default: 0): Number of records to skip

        * `maxResultCount` (integer, optional, default: 20): Maximum records to
        return

        * `channelId` (string, optional): Filter by channel ID (format:
        channel_<guid>)

        * `status` (enum, optional): Filter by status (`pending`, `sent`,
        `failed`, `partial`, `success`)

        * `createdAtStart` (datetime, optional): Filter messages created on or
        after this time (ISO 8601, e.g. `2026-05-01T00:00:00Z`)

        * `createdAtEnd` (datetime, optional): Filter messages created on or
        before this time (ISO 8601)

        * `sentAtStart` (datetime, optional): Filter messages sent on or after
        this time (ISO 8601)

        * `sentAtEnd` (datetime, optional): Filter messages sent on or before
        this time (ISO 8601)


        **Responses**


        * `200 OK`: Messages retrieved successfully.

        * `400 Bad Request`: Invalid query parameter format.
      parameters:
        - name: channelId
          in: query
          schema:
            type: string
        - name: status
          in: query
          schema:
            $ref: '#/components/schemas/MessageStatus'
        - name: createdAtStart
          in: query
          schema:
            type: string
            format: date-time
        - name: createdAtEnd
          in: query
          schema:
            type: string
            format: date-time
        - name: sentAtStart
          in: query
          schema:
            type: string
            format: date-time
        - name: sentAtEnd
          in: query
          schema:
            type: string
            format: date-time
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: Messages retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageListItemDtoPagedResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.InvalidQueryParam
                title: Bad Request
                status: 400
                detail: >-
                  Invalid value for query parameter 'channelId'. Expected
                  format: channel_<guid>
                instance: /api/v1/notifications/messages
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/alert-rules:
    post:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Create alert rule
      description: "Create a new alert rule with defined conditions and actions.\r\n\r\n**Responses**\r\n\r\n* `201 Created`: returns the created alert rule.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleEngineCreateWithoutDeviceIdRequest'
            example:
              ruleName: High CPU Usage Alert
              dataObjectName: cpuUsage
              alertLevel: '>=70'
              alertResetLevel: <70
              delay: 5
              notification:
                channelIds:
                  - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                recipients:
                  - name: null
                    target: ops-team@example.com
                    type: to
                variables:
                  dataObjectName: cpuUsage
                  alertLevel: '>=70'
                subject: null
                content: null
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleEngineDto'
              example:
                alertRuleId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                ruleName: High CPU Usage Alert
                isEnabled: true
                dataObjectName: cpuUsage
                alertLevel: '>=70'
                alertResetLevel: <70
                delay: 5
                lastModificationTime: '2026-03-16T08:05:00+00:00'
                creationTime: '2026-03-16T08:00:00+00:00'
                notification:
                  channelIds:
                    - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                  templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                  recipients:
                    - name: Ops Team
                      target: ops-team@example.com
                      type: to
                  variables:
                    dataObjectName: cpuUsage
                    alertLevel: '>=70'
                  subject: null
                  content: null
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Get alert rules with pagination
      description: "Retrieve a paginated list of alert rules for a specific device.\r\n\r\n**Parameters**\r\n\r\n* `keyword` (string, optional): Fuzzy search keyword across RuleName and DataObjectName fields. Supports multiple keywords separated by comma (e.g., `temp,alert`). The search is case-sensitive and performs partial matching.\r\n* `skipCount` (integer, optional): Number of items to skip for pagination. Default: `0`\r\n* `maxResultCount` (integer, optional): Maximum number of items to return per page. Default: `10`\r\n* `sorting` (string, optional): Sorting criteria using format `FieldName [ASC|DESC]`. Supports multiple fields separated by comma.\r\n  - Available fields: `RuleName`, `IsEnabled`, `DataObjectName`, `AlertLevel`, `AlertResetLevel`, `Delay`, `CreationTime`, `LastModificationTime`\r\n  - Default: `CreationTime ASC`\r\n  - Examples: `CreationTime DESC`, `RuleName ASC, Delay DESC`\r\n\r\n**Responses**\r\n\r\n* `200 OK`: Returns a paginated list of alert rules for the specified device.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: keyword
          in: query
          description: >-
            Keyword for fuzzy search across RuleName and DataObjectName fields.
            Multiple keywords can be separated by comma
          schema:
            type: string
            description: >-
              Keyword for fuzzy search across RuleName and DataObjectName
              fields. Multiple keywords can be separated by comma
        - name: sorting
          in: query
          schema:
            type: string
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleEngineDtoPagedResultDto'
              example:
                totalCount: 2
                items:
                  - alertRuleId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                    ruleName: High CPU Usage Alert
                    isEnabled: true
                    dataObjectName: cpuUsage
                    alertLevel: '>=70'
                    alertResetLevel: <70
                    delay: 5
                    lastModificationTime: '2026-03-16T08:05:00+00:00'
                    creationTime: '2026-03-16T08:00:00+00:00'
                    notification:
                      channelIds:
                        - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                      templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                      recipients:
                        - name: Ops Team
                          target: ops-team@example.com
                          type: to
                      variables:
                        dataObjectName: cpuUsage
                        alertLevel: '>=70'
                      subject: null
                      content: null
                  - alertRuleId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                    ruleName: Low Memory Warning
                    isEnabled: false
                    dataObjectName: memoryUsage
                    alertLevel: '>=90'
                    alertResetLevel: <85
                    delay: 0
                    lastModificationTime: null
                    creationTime: '2026-03-16T09:00:00+00:00'
                    notification: null
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/alert-rules/{alertRuleId}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Get alert rule by ID
      description: "Retrieve detailed information of a specific alert rule.\r\n\r\n**Parameters**\r\n\r\n* `alertRuleId` (Guid, required): Unique identifier of the alert rule. Example: `3f2504e0-4f89-11d3-9a0c-0305e82c3301`\r\n\r\n**Responses**\r\n\r\n* `200 OK`: returns the specified alert rule.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Define which device''s rule will be query. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: alertRuleId
          in: path
          description: >-
            Alert rule unique identifier. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleEngineDto'
              example:
                alertRuleId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                ruleName: High CPU Usage Alert
                isEnabled: true
                dataObjectName: cpuUsage
                alertLevel: '>=70'
                alertResetLevel: <70
                delay: 5
                lastModificationTime: '2026-03-16T08:05:00+00:00'
                creationTime: '2026-03-16T08:00:00+00:00'
                notification:
                  channelIds:
                    - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                  templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                  recipients:
                    - name: Ops Team
                      target: ops-team@example.com
                      type: to
                  variables:
                    dataObjectName: cpuUsage
                    alertLevel: '>=70'
                  subject: null
                  content: null
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Update alert rule
      description: "Update an existing alert rule.\r\n\r\n**Parameters**\r\n\r\n* `alertRuleId` (Guid, required): Unique identifier of the alert rule. Example: `3f2504e0-4f89-11d3-9a0c-0305e82c3301`  \r\n\r\n**Responses**\r\n\r\n* `200 OK`: returns the updated alert rule.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Define which device''s rule to be update. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: alertRuleId
          in: path
          description: >-
            Alert rule unique identifier. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Alert rule update request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceRequest'
            example:
              alertLevel: '>=70'
              alertResetLevel: <=50
              delay: 5
              notification:
                channelIds:
                  - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                recipients:
                  - name: null
                    target: ops-team@example.com
                    type: to
                variables: null
                subject: null
                content: null
          text/json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceRequest'
            example:
              alertLevel: '>=70'
              alertResetLevel: <=50
              delay: 5
              notification:
                channelIds:
                  - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                recipients:
                  - name: null
                    target: ops-team@example.com
                    type: to
                variables: null
                subject: null
                content: null
          application/*+json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceRequest'
            example:
              alertLevel: '>=70'
              alertResetLevel: <=50
              delay: 5
              notification:
                channelIds:
                  - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                recipients:
                  - name: null
                    target: ops-team@example.com
                    type: to
                variables: null
                subject: null
                content: null
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleEngineDto'
              example:
                alertRuleId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                ruleName: High CPU Usage Alert
                isEnabled: true
                dataObjectName: cpuUsage
                alertLevel: '>=70'
                alertResetLevel: <70
                delay: 5
                lastModificationTime: '2026-03-16T08:05:00+00:00'
                creationTime: '2026-03-16T08:00:00+00:00'
                notification:
                  channelIds:
                    - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                  templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                  recipients:
                    - name: Ops Team
                      target: ops-team@example.com
                      type: to
                  variables:
                    dataObjectName: cpuUsage
                    alertLevel: '>=70'
                  subject: null
                  content: null
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Delete alert rule
      description: "Delete an alert rule by its ID.\r\n\r\n**Parameters**\r\n\r\n* `alertRuleId` (Guid, required): Unique identifier of the alert rule. Example: `3f2504e0-4f89-11d3-9a0c-0305e82c3301`\r\n\r\n**Responses**\r\n\r\n* `204 No Content`: indicates the rule was successfully deleted.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Define which device''s rule will be update. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: alertRuleId
          in: path
          description: >-
            Alert rule unique identifier. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/alert-rules/{alertRuleId}/status:
    put:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Update alert rule status
      description: "Enable or disable an existing alert rule.\r\n\r\n**Parameters**\r\n\r\n* `alertRuleId` (Guid, required): Unique identifier of the alert rule. Example: `3f2504e0-4f89-11d3-9a0c-0305e82c3301`  \r\n\r\n**Responses**\r\n\r\n* `200 OK`: returns the alert rule with updated status.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Define which device''s rule will be update. Example: `9f75abda56c3`'
          required: true
          schema:
            type: string
        - name: alertRuleId
          in: path
          description: >-
            Alert rule unique identifier. Example:
            `3f2504e0-4f89-11d3-9a0c-0305e82c3301`
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Alert rule status update request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceStatusRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceStatusRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/RuleEngineReplaceStatusRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleEngineDto'
              example:
                alertRuleId: 3f2504e0-4f89-11d3-9a0c-0305e82c3301
                ruleName: High CPU Usage Alert
                isEnabled: true
                dataObjectName: cpuUsage
                alertLevel: '>=70'
                alertResetLevel: <70
                delay: 5
                lastModificationTime: '2026-03-16T08:05:00+00:00'
                creationTime: '2026-03-16T08:00:00+00:00'
                notification:
                  channelIds:
                    - channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
                  templateId: tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
                  recipients:
                    - name: Ops Team
                      target: ops-team@example.com
                      type: to
                  variables:
                    dataObjectName: cpuUsage
                    alertLevel: '>=70'
                  subject: null
                  content: null
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/values:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Get device telemetry data with cursor-based pagination
      description: "Retrieve telemetry data objects for a device using cursor-based pagination for better performance.\r\n\r\n**Why Cursor-based Pagination?**\r\n- **Much faster** than offset-based pagination, especially for large datasets\r\n- **Constant performance** regardless of page depth (page 1 and page 1000 have same speed)\r\n- **No expensive OFFSET** operations that skip thousands of records\r\n- **No totalCount calculation** - avoids heavy COUNT queries\r\n\r\n**How to Use**:\r\n1. **First request**: Omit the `cursor` parameter\r\n2. **Subsequent requests**: Use `nextCursor` from previous response as `cursor` parameter\r\n3. **Continue** until `hasMore` is false\r\n\r\n**Parameters**\r\n\r\n* `deviceId` (string, required): Unique identifier of the device. Example: `74fe488d5d35`  \r\n* `start` (DateTime, required): Start timestamp of the query range. Example: `2025-09-01T00:00:00Z`\r\n* `end` (DateTime, required): End timestamp of the query range. Example: `2025-09-02T00:00:00Z`\r\n* `cursor` (long, optional): Cursor timestamp from previous page (Unix milliseconds). Omit for first page.\r\n* `limit` (int, optional): Maximum results per page (default: 17, max: 1000).\r\n\r\n**Response Fields**:\r\n* `items`: Array of telemetry records\r\n* `nextCursor`: Timestamp to use for next page (null if no more data)\r\n* `hasMore`: Whether there are more pages available\r\n\r\n**Example Usage**:\r\n```\r\n# First page\r\nGET /devices/74fe488d5d35/inputs/data-objects?start=2025-01-01T00:00:00Z&end=2025-01-02T00:00:00Z&limit=100\r\n\r\n# Second page (use nextCursor from first response)\r\nGET /devices/74fe488d5d35/inputs/data-objects?start=2025-01-01T00:00:00Z&end=2025-01-02T00:00:00Z&cursor=1704153600000&limit=100\r\n```\r\n\r\n**Responses**\r\n\r\n* `200 OK`: returns cursor-based paginated data object values.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Unique identifier Example : 74fe488d5d35'
          required: true
          schema:
            type: string
        - name: start
          in: query
          description: 'Start timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          required: true
          schema:
            type: string
            format: date-time
        - name: end
          in: query
          description: 'End timestamp in ISO 8601 format. Example: 2025-09-02T00:00:00Z'
          required: true
          schema:
            type: string
            format: date-time
        - name: cursor
          in: query
          description: >-
            Cursor timestamp (Unix milliseconds). For first page, omit this
            parameter.
          schema:
            type: integer
            description: >-
              Cursor timestamp (Unix milliseconds). For first page, omit this
              parameter.
            format: int64
        - name: limit
          in: query
          description: 'Maximum number of results to return (default: 17, max: 1000)'
          schema:
            type: integer
            description: 'Maximum number of results to return (default: 17, max: 1000)'
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/TelemetryResponseDtoDataObjectsCursorBasedResultDto
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/data-objects/values/latest:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Data Objects
      summary: Retrieve the latest values of the device data objects.
      description: "Retrieve all latest data objects for the device within the system - defined retention period(default: 60 minutes).\r\n\r\n**Parameters**\r\n\r\n* `deviceId` (string, required): Unique ID of the device. Example: `74fe488d5d35`\r\n\r\n**Responses**\r\n\r\n* `200 OK`: Returns the latest CPQ data including value object, value type, timestamp, and data object name.\r\n* `204 No Content`: No cached data available for the specified device.\r\n\r\n**Security**\r\n\r\n* This API requires authentication."
      parameters:
        - name: deviceId
          in: path
          description: 'Device unique ID Example : 74fe488d5d35'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelemetryResponseDtoDataObjects'
              example:
                deviceId: 74fe488d5d35
                time: '2025-09-01T08:00:00Z'
                dataObjects:
                  temperature: 23.5
                  humidity: 60
                  cpuUsage: 42.1
                dataTypes:
                  - double
                  - double
                  - double
        '204':
          description: No Content
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/templates:
    post:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Create template
      description: >-
        Create a new message template with variable support.


        **Request Body**


        Template creation data including name, subject, content, and supported
        channel types.


        **Variable Syntax**: `{variableName}`


        **Responses**


        * `201 OK`: Template created successfully.

        * `400 Bad Request`: Validation error or invalid template variable
        syntax.

        * `409 Conflict`: Template with same name exists.

        * `404 Not Found`: Channel type not found.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplateDto'
            example:
              name: Welcome Email Template
              subject: Welcome to {companyName}
              content: |-
                Dear {userName},

                Welcome to our platform!

                Your account: {email}
              channelTypes:
                - email
              tags:
                - welcome
                - onboarding
      responses:
        '201':
          description: Template created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateResponseDto'
              example:
                templateId: template_abc12345-6789-0abc-def0-123456789abc
                name: Welcome Email Template
                subject: Welcome to {companyName}
                content: |-
                  Dear {userName},

                  Welcome to our platform!
                channelTypes:
                  - email
                tags:
                  - welcome
                  - onboarding
                createdAt: '2026-05-21T10:18:39.4563662Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Notification.InvalidTemplateVariable
                title: Bad Request
                status: 400
                detail: >-
                  Invalid template variable syntax: '{{userName' - missing
                  closing braces
                instance: /notification/templates
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: Channel type 'invalid-type' not found
                instance: /notification/channels/registry-info/types/invalid-type
        '409':
          description: Conflict
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.AlreadyExists
                title: Conflict
                status: 409
                detail: Template with name 'WelcomeEmail' already exists
                instance: /notification/templates
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: List templates
      description: >-
        List templates with optional filtering and pagination.


        **Parameters**


        * `skipCount` (integer, optional, default: 0): Number of records to skip

        * `maxResultCount` (integer, optional, default: 20, max: 100): Maximum
        records to return

        * `channelType` (enum, optional): Filter by channel type

        * `tags` (string[], optional): Filter by tags


        **Responses**


        * `200 OK`: Templates retrieved successfully.

        * `400 Bad Request`: Invalid pagination parameters.
      parameters:
        - name: name
          in: query
          schema:
            type: string
        - name: channelType
          in: query
          schema:
            $ref: '#/components/schemas/ChannelType'
        - name: tags
          in: query
          schema:
            type: array
            items:
              type: string
        - name: skipCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
        - name: maxResultCount
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: Templates retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateListItemDtoPagedResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
      security:
        - oidc: []
        - Bearer: []
  /api/v1/notifications/templates/{templateId}:
    get:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Get template
      description: >-
        Retrieve template details.


        **Parameters**


        * `templateId` (string, required): Template identifier (format:
        template_xxx)


        **Responses**


        * `200 OK`: Template retrieved successfully.

        * `404 Not Found`: Template not found.

        * `400 Bad Request`: Invalid template ID format.
      parameters:
        - name: templateId
          in: path
          description: 'Template identifier (format: template_xxx)'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Template retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetailDto'
              example:
                templateId: template_abc12345-6789-0abc-def0-123456789abc
                name: Welcome Email Template
                subject: Welcome to {companyName}
                content: |-
                  Dear {userName},

                  Welcome to our platform!
                channelTypes:
                  - email
                tags:
                  - welcome
                  - onboarding
                createdAt: '2026-05-21T10:18:39.4665721Z'
                updatedAt: '2026-05-21T10:18:39.4665722Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Template with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/templates/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
    patch:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Update template
      description: >-
        Update template content (partial update supported).


        **Parameters**


        * `templateId` (string, required): Template identifier (format:
        template_xxx)


        **Request Body**


        Template update data (all fields optional).


        **Responses**


        * `200 OK`: Template updated successfully.

        * `404 Not Found`: Template not found.

        * `400 Bad Request`: Validation error or invalid template variable
        syntax.
      parameters:
        - name: templateId
          in: path
          description: 'Template identifier (format: template_xxx)'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplateDto'
            example:
              name: null
              subject: Welcome to {companyName} - Updated
              content: |-
                Dear {userName},

                Welcome to our updated platform!
              channelTypes: null
              tags:
                - welcome
                - onboarding
                - v2
      responses:
        '200':
          description: Template updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetailDto'
              example:
                templateId: template_abc12345-6789-0abc-def0-123456789abc
                name: Welcome Email Template
                subject: Welcome to {companyName}
                content: |-
                  Dear {userName},

                  Welcome to our platform!
                channelTypes:
                  - email
                tags:
                  - welcome
                  - onboarding
                createdAt: '2026-05-21T10:18:39.4735221Z'
                updatedAt: '2026-05-21T10:18:39.4735222Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Notification.InvalidTemplateVariable
                title: Bad Request
                status: 400
                detail: >-
                  Invalid template variable syntax: '{{userName' - missing
                  closing braces
                instance: /notification/templates
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Template with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/templates/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_5-datapoints_swagger_json_Notifications
      summary: Delete template
      description: >-
        Delete a template permanently.


        **Parameters**


        * `templateId` (string, required): Template identifier (format:
        template_xxx)


        **Responses**


        * `204 No Content`: Template deleted successfully.

        * `404 Not Found`: Template not found.

        * `400 Bad Request`: Invalid template ID format.
      parameters:
        - name: templateId
          in: path
          description: 'Template identifier (format: template_xxx)'
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Template deleted successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                type: WEDA.Common.PropertyFormatError
                title: Bad Request
                status: 400
                detail: >-
                  Invalid format for property 'maxResultCount'. Expected format:
                  integer between 1 and 100
                instance: /notification/channels
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                type: CommonError.NotFound
                title: Not Found
                status: 404
                detail: >-
                  Template with ID 'abc12345-6789-0abc-def0-123456789abc' not
                  found
                instance: /notification/templates/abc12345-6789-0abc-def0-123456789abc
      security:
        - oidc: []
        - Bearer: []
  /api/v1/devices/{deviceId}/tunnels/sessions:
    post:
      tags:
        - ___swagger_6-tunnel-management_swagger_json_Tunnels
      summary: Create tunnel session
      description: >-
        If no client connects to a tunnel within 120 seconds of its creation,
        the tunnel will be closed automatically. 

        In addition, a tunnel's maximum lifetime is 3600 seconds, after which it
        is closed regardless of activity.
                    
        **Required fields:**

        - `serviceType` — Protocol to tunnel (e.g. `"ssh"`, `"http"`, `"vnc"`).
        Default: `"ssh"`.

        - `applicationHost` — The intranet IP address of the edge device's
        target service (e.g. `"192.168.1.100"`). Must be a valid IPv4/IPv6
        address or hostname reachable from the device's local network.

        - `applicationPort` — Port the target service is listening on (e.g. `22`
        for SSH). Range: 0–65535.

        - `purpose` — Brief justification for creating the tunnel (e.g. `"Remote
        maintenance"`).

        - `tags` — A list of free-form labels for categorization, filtering, and
        auditing (e.g. `["ops", "critical"]`). Use tags to group related
        tunnels, identify ownership, or enable dashboard filtering.
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device.
          required: true
          schema:
            type: string
      requestBody:
        description: The details required to create the tunnel session.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTunnelDto'
            example:
              serviceType: ssh
              applicationHost: 192.168.1.100
              applicationPort: 22
              purpose: Remote maintenance
              tags:
                - ops
                - critical
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TunnelDto'
              example:
                tunnelSessionId: 8145286f-ba59-4ca8-961e-6338a795b98e
                deviceId: 74fe488d5d54
                serviceType: ssh
                applicationPort: 22
                applicationHost: 192.168.1.100
                creationTime: '2025-11-18T02:28:33.7315762Z'
                purpose: Remote maintenance
                tags:
                  - ops
                  - critical
                sessionStatus: ESTABLISHING
                tunnelEndpoint: null
                webSsh: null
                estimatedReadyTime: null
                lastHeartbeatTime: null
                terminatedTime: null
                lastModificationTime: null
                terminationSource: null
                terminationReason: null
                links:
                  self:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: GET
                  update:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: PATCH
                  terminate:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: DELETE
                  list:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels
                    method: GET
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: ValidationError
                  message: Bad Request - Invalid request parameters
                  details: null
                  data: null
                  validationErrors:
                    - message: Request body is invalid.
                      members: []
                    - message: ApplicationHost is invalid.
                      members:
                        - ApplicationHost
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: null
                  message: An internal error occurred during your request!
                  details: null
                  data: null
                  validationErrors: null
      security:
        - Bearer: []
    get:
      tags:
        - ___swagger_6-tunnel-management_swagger_json_Tunnels
      summary: List device tunnels
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device.
          required: true
          schema:
            type: string
        - name: sessionStatus
          in: query
          description: >-
            Filter by tunnel session status (ESTABLISHING, ESTABLISHED,
            TERMINATING, TERMINATED).

            If null, no status filtering is applied.
          schema:
            $ref: '#/components/schemas/TunnelSessionStatus'
        - name: serviceType
          in: query
          description: |-
            Filter by service type being tunneled (e.g., SSH, RDP).
            If null, no service type filtering is applied.
          schema:
            $ref: '#/components/schemas/ServiceType'
        - name: tags
          in: query
          description: |-
            Filter by tags. Returns tunnels that have any of the specified tags.
            Empty list means no tag filtering is applied.
          schema:
            type: array
            items:
              type: string
        - name: maxResultCount
          in: query
          description: Maximum number of results to return. Must be between 1 and 1000.
          schema:
            maximum: 1000
            minimum: 1
            type: integer
            format: int32
        - name: skipCount
          in: query
          description: Number of results to skip for pagination.
          schema:
            type: integer
            format: int32
        - name: sorting
          in: query
          description: >-
            Sorting expression for the results (e.g.,
            creationTime,sessionStatus,tags).

            Default is "CreationTime desc".
          schema:
            type: string
            default: creationTime desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResultDto of TunnelDto'
              example:
                totalCount: 1
                items:
                  - tunnelSessionId: 8145286f-ba59-4ca8-961e-6338a795b98e
                    deviceId: 74fe488d5d54
                    serviceType: ssh
                    applicationPort: 22
                    applicationHost: 192.168.1.100
                    creationTime: '2025-11-27T01:15:20.325367Z'
                    purpose: Remote maintenance
                    tags:
                      - ops
                      - critical
                    sessionStatus: ESTABLISHED
                    tunnelEndpoint: 172.22.23.10:11100
                    webSsh: http://172.22.23.10:2222/ssh/host/172.22.23.10?port=11100
                    estimatedReadyTime: '2025-11-27T01:15:21.587Z'
                    lastHeartbeatTime: '2025-11-27T01:15:21.587Z'
                    terminatedTime: null
                    lastModificationTime: null
                    terminationSource: null
                    terminationReason: null
                    links:
                      self:
                        href: >-
                          https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                        method: GET
                      update:
                        href: >-
                          https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                        method: PATCH
                      terminate:
                        href: >-
                          https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                        method: DELETE
                      list:
                        href: >-
                          https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels
                        method: GET
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: InvalidSortingPropertyError
                  message: >-
                    Invalid sorting property: 'creationTim'. Valid properties
                    are: CreationTime, SessionStatus, Tags
                  details: null
                  data: null
                  validationErrors: null
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: null
                  message: An internal error occurred during your request!
                  details: null
                  data: null
                  validationErrors: null
      security:
        - Bearer: []
  /api/v1/devices/{deviceId}/tunnels/sessions/{tunnelSessionId}:
    delete:
      tags:
        - ___swagger_6-tunnel-management_swagger_json_Tunnels
      summary: Terminates an existing tunnel session
      description: >-
        Initiates a graceful or immediate shutdown of the specified tunnel
        session.
                    
        **Preconditions:** The session must NOT already be in a terminal or
        transitioning state.

        A 400 error is returned if the current `sessionStatus` is `TERMINATED`,
        `TERMINATING`, or `FAILED`.
                    
        **Request body:**

        - `reason` — Human-readable explanation for the termination.

        - `graceful` — When `true`, the agent honours the `forceTimeout` before
        hard-closing existing connections.

        - `forceTimeout` — Maximum seconds to wait for graceful closure before
        forcing (only applies when `graceful=true`).
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device.
          required: true
          schema:
            type: string
        - name: tunnelSessionId
          in: path
          description: The unique identifier of the tunnel session.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Termination options and reason.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminateTunnelDto'
            example:
              reason: No longer needed
              graceful: true
              forceTimeout: 30
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TunnelDto'
              example:
                tunnelSessionId: 8145286f-ba59-4ca8-961e-6338a795b98e
                deviceId: 74fe488d5d54
                serviceType: ssh
                applicationPort: 22
                applicationHost: 192.168.1.100
                creationTime: '2025-11-27T01:15:20.325367Z'
                purpose: Remote maintenance
                tags:
                  - ops
                  - critical
                sessionStatus: TERMINATING
                tunnelEndpoint: 172.22.23.10:11100
                webSsh: http://172.22.23.10:2222/ssh/host/172.22.23.10?port=11100
                estimatedReadyTime: '2025-11-27T01:15:21.587Z'
                lastHeartbeatTime: '2025-11-27T01:15:21.587Z'
                terminatedTime: null
                lastModificationTime: null
                terminationSource: null
                terminationReason: null
                links:
                  self:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: GET
                  update:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: PATCH
                  terminate:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: DELETE
                  list:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels
                    method: GET
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: ResourceNotFound
                  message: >-
                    Tunnel Session Not Found. Input tunnelSessionId:
                    3f3c1618-a6fb-4b4a-92ee-818b99491ba7
                  details: null
                  data: null
                  validationErrors: null
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: null
                  message: An internal error occurred during your request!
                  details: null
                  data: null
                  validationErrors: null
      security:
        - Bearer: []
    get:
      tags:
        - ___swagger_6-tunnel-management_swagger_json_Tunnels
      summary: Get tunnel detail information
      parameters:
        - name: deviceId
          in: path
          description: The unique identifier of the target device.
          required: true
          schema:
            type: string
        - name: tunnelSessionId
          in: path
          description: The unique identifier of the tunnel session.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TunnelDetailDto'
              example:
                healthStatus: HEALTHY
                tunnelSessionId: 8145286f-ba59-4ca8-961e-6338a795b98e
                deviceId: 74fe488d5d54
                serviceType: ssh
                applicationPort: 22
                applicationHost: 192.168.1.100
                creationTime: '2025-11-27T01:15:20.325367Z'
                purpose: Remote maintenance
                tags:
                  - ops
                  - critical
                sessionStatus: ESTABLISHED
                tunnelEndpoint: 172.22.23.10:11100
                webSsh: http://172.22.23.10:2222/ssh/host/172.22.23.10?port=11100
                estimatedReadyTime: '2025-11-27T01:15:21.587Z'
                lastHeartbeatTime: '2025-11-27T01:15:21.587Z'
                terminatedTime: null
                lastModificationTime: '2025-11-27T01:15:22.587Z'
                terminationSource: null
                terminationReason: null
                links:
                  self:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: GET
                  update:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: PATCH
                  terminate:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels/8145286f-ba59-4ca8-961e-6338a795b98e
                    method: DELETE
                  list:
                    href: >-
                      https://localhost:44375/api/v1/devices/74fe488d5d54/tunnels
                    method: GET
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: ValidationError
                  message: Bad Request - Invalid request parameters
                  details: null
                  data: null
                  validationErrors: null
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: ResourceNotFound
                  message: >-
                    Tunnel Session Not Found. Input tunnelSessionId:
                    3f3c1618-a6fb-4b4a-92ee-818b99491ba7
                  details: null
                  data: null
                  validationErrors: null
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                error:
                  code: null
                  message: An internal error occurred during your request!
                  details: null
                  data: null
                  validationErrors: null
      security:
        - Bearer: []
  /api/v1/reports/subscriptions:
    post:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Create a new Subscription.
      description: Create a new Subscription with the provided details.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Get all Subscriptions.
      description: Retrieve all Subscriptions.
      parameters:
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
            default: 0
        - name: maxResultCount
          in: query
          schema:
            type: integer
            format: int32
            default: 10
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDtoPagedResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/subscriptions/{subscriptionId}:
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Get a Subscription.
      description: Retrieve a Subscription by its ID.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    put:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Update a Subscription.
      description: Update an existing Subscription with the provided details.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Delete a Subscription.
      description: Delete a Subscription by its ID.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/subscriptions/{subscriptionId}/deliveries:
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Get Subscription Deliveries.
      description: Retrieve deliveries for a specific Subscription.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeliveryRecordDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/subscriptions/{subscriptionId}/status:
    patch:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Update Subscription Status.
      description: Activate or deactivate a Subscription.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: isEnabled
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/subscriptions/{subscriptionId}:execute:
    post:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Execute a Subscription.
      description: Immediately execute the specified Subscription.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/usage-jobs:
    post:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Create a new usage summary task
      description: "This task will automatically send a usage summary request for each specified period until the end time.\r\nA unique task usageJobId will be generated when the task is created.\r\n\r\nYou can use the search API to retrieve the task usageJobId and then use the usageJobId to download the report.\r\n\r\nThe endTime must be later than setting date at least one period.\r\n\r\n**Limitations**\r\n- repeatPeriod: Daily, Weekly, or Monthly\r\n- endTime: ISO8601 format YYYY-MM-DD\r\n- timeZone: +08:30\r\n- jobs: ActiveDeviceCount or DataPointCount\r\n{\r\n    message: end time format error.\r\n}\r\n\r\n"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduledJobRequestDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateScheduleResultDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Get all usage summary tasks
      description: "This API retrieves information about all tasks, including schedule IDs and detailed settings.\r\n\r\nYou can use skipCount to control the starting point of the returned results.\r\nUse maxResultCount to limit the number of results returned.\r\n"
      parameters:
        - name: skipCount
          in: query
          schema:
            type: integer
            format: int32
            default: 0
        - name: maxResultCount
          in: query
          schema:
            type: integer
            format: int32
            default: 10
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetScheduledJobResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/usage-jobs/{usageJobId}:
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Retrieve a single usage summary task
      description: "This API retrieves the details of a single usage summary task identified by usageJobId.\r\n\r\nThe response includes all settings and configuration details of the task, such as schedule information, repeat period, end time, time zone, and job sorting options.\r\n\r\nIf the specified task does not exist or an error occurs while fetching the task, a 500 status code is returned with an error message containing the taskusageJobIdand the error description.\r\n\r\n**Parameters**\r\n- usageJobId: The unique identifier of the usage summary task to retrieve (required).\r\n\r\n**Notes**\r\n- Ensure the usageJobId is correct.\r\n- The API only retrieves the task information; it does not modify or delete the task.\r\n- The returned object can be used to review or update the task via the update API.\r\n"
      parameters:
        - name: usageJobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetScheduledJobResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    put:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Update an exist usage summary task
      description: "This API updates an existing usage summary task using the provided usageJobId and new settings.\r\n\r\nThe task will continue to send usage summary requests according to the updated schedule until the end time.\r\nA unique task usageJobId is associated with the task and remains unchanged.\r\n\r\nThe endTime must be later than the setting date by at least one period.\r\n\r\n* Limitations:\r\n- usageJobId: The unique identifier of the usage summary task to retrieve (required).\r\n- repeatPeriod: Daily, Weekly, or Monthly\r\n- endTime: ISO8601 format YYYY-MM-DD\r\n- timeZone: +08:30\r\n- Job sorting options: ActiveDeviceCount or DataPointCount\r\n"
      parameters:
        - name: usageJobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePutScheduledJobRequestDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetScheduledJobResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
    delete:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Delete a single usage summary task
      description: "This API deletes an existing usage summary task identified by the provided usageJobId.\r\n\r\nWhen the task is successfully deleted, it will no longer send any usage summary requests.\r\n\r\nIf the specified usageJobId does not exist, an error message will be returned.\r\n\r\n**Notes**\r\n- Make sure the usageJobId is correct before calling this API.\r\n- Deleting a task is irreversible.\r\n"
      parameters:
        - name: usageJobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
  /api/v1/reports/usage-jobs/{usageJobId}/summaries:
    get:
      tags:
        - ___swagger_7-reports_swagger_json_Reports
      summary: Download an usage summary report
      description: "This API downloads a usage summary report for a specified task identified by usageJobId.\r\n\r\nYou can provide a startTime and endTime in yyyy-MM-dd format to define the reporting period.\r\nThe format parameter specifies the download file format, currently only json is supported.\r\n\r\nUpon success, the API returns the report file as a downloadable JSON file named summary-report-{usageJobId}.json.\r\n\r\nIf the task does not exist or an error occurs during report generation, a 500 status code is returned with an error message.\r\n\r\n**Parameters**\r\n1. usageJobId: The unique identifier of the usage summary task to retrieve (required).\r\n2. startTime: Start date of the report in yyyy-MM-dd format (required).\r\n3. endTime: End date of the report in yyyy-MM-dd format (required).\r\n4. format: File format for download, default is json.\r\n\r\n**Notes**\r\n- Ensure the usageJobId is correct and the task exists.\r\n- The report includes data points for the specified period only.\r\n- Downloading a report does not modify or delete the task.\r\n"
      parameters:
        - name: usageJobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: startTime
          in: query
          description: Start date in yyyy-MM-dd format 2025-01-01
          required: true
          schema:
            type: string
            description: Start date in yyyy-MM-dd format 2025-01-01
            default: '2025-01-01'
        - name: endTime
          in: query
          description: Start date in yyyy-MM-dd format 2026-01-01
          required: true
          schema:
            type: string
            description: Start date in yyyy-MM-dd format 2026-01-01
            default: '2026-01-01'
        - name: format
          in: query
          description: Download file format, json
          schema:
            type: string
            description: Download file format, json
            default: json
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oidc: []
        - Bearer: []
components:
  schemas:
    AdminInfoDto:
      type: object
      properties:
        userId:
          type: string
          description: Admin user's unique identifier
          nullable: true
        name:
          type: string
          description: Admin user's name
          nullable: true
        email:
          type: string
          description: Admin user's email address
          nullable: true
      additionalProperties: false
    AdminUserDto:
      required:
        - userId
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: |-
            Admin user's ID.  
                Example : 783707f1-0659-4892-a872-8f506d225d7b
      additionalProperties: false
    AppUserDisplayDto:
      type: object
      properties:
        userId:
          type: string
          description: User's id
          nullable: true
        firstName:
          type: string
          description: User's first name
          nullable: true
        lastName:
          type: string
          description: User's last name
          nullable: true
        name:
          type: string
          description: User's name
          nullable: true
        email:
          type: string
          description: User's email address
          nullable: true
        role:
          type: string
          description: User role in the current system
          nullable: true
        account:
          type: string
          description: User role in the current system
          nullable: true
      additionalProperties: false
    AppUserDisplayDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AppUserDisplayDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    CreateOrgDto:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 1
          type: string
          description: 'Organization''s name. Example : MainOrg'
        description:
          maxLength: 200
          minLength: 0
          type: string
          description: Organization's description. Optional, max length 200.
          nullable: true
        parentOrgId:
          type: string
          description: |2-

                Parent organization ID, if applicable  
                Example : 783707f1-0659-4892-a872-8f506d225d7b
                
          nullable: true
        admins:
          type: array
          items:
            $ref: '#/components/schemas/AdminUserDto'
          description: |-
            Organization's Admins.  
                Example : [{"userId": "admin1"}, {"userId": "admin2"}]
          nullable: true
      additionalProperties: false
    CreateOrgResponseDto:
      type: object
      properties:
        name:
          type: string
          description: Organization's name
          nullable: true
        orgId:
          type: string
          description: Organization's unique identifier
          format: uuid
        parentOrgId:
          type: string
          description: Parent organization ID, if applicable
          format: uuid
          nullable: true
        description:
          type: string
          description: Organization's description
          nullable: true
        admins:
          type: array
          items:
            $ref: '#/components/schemas/OrgUserCreateResponseDto'
          description: Organization's Admins
          nullable: true
        dateCreated:
          type: string
          description: Organization's creation time
          format: date-time
        dateModified:
          type: string
          description: Organization's last modification time
          format: date-time
          nullable: true
      additionalProperties: false
    CreatePatDto:
      required:
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        expiredAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
          nullable: true
        scopes:
          minItems: 1
          type: array
          items:
            type: string
          nullable: true
        deviceIds:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    CreateUpdateOrgDto:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 1
          type: string
          description: 'Organization''s name. Example : MainOrg'
        description:
          maxLength: 200
          minLength: 0
          type: string
          description: Organization's description. Optional, max length 200.
          nullable: true
      additionalProperties: false
    CreateUpdateOrgUserDtoNoOrg:
      required:
        - orgRole
        - userId
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: >-
            The ID of the user to be added to the organization. Example :
            783707f1-0659-4892-a872-8f506d225d7b
        orgRole:
          minLength: 1
          type: string
          description: >-
            The user's role within the organization. Accepts 'admin'
            (case-insensitive).
      additionalProperties: false
    OrgDto:
      type: object
      properties:
        name:
          type: string
          description: Organization's name
          nullable: true
        orgId:
          type: string
          description: Organization's unique identifier
          format: uuid
        parentOrgId:
          type: string
          description: Parent organization ID, if applicable
          format: uuid
          nullable: true
      additionalProperties: false
    OrgDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrgDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    OrgTreeDetailDto:
      type: object
      properties:
        orgId:
          type: string
          description: Organization's unique identifier
          format: uuid
        parentOrgId:
          type: string
          description: Parent organization ID, if applicable
          format: uuid
          nullable: true
        name:
          type: string
          description: Organization's name
          nullable: true
        description:
          type: string
          description: Organization's description
          nullable: true
        admins:
          type: array
          items:
            $ref: '#/components/schemas/AdminInfoDto'
          description: List of admin users for the organization
          nullable: true
        orgRole:
          $ref: '#/components/schemas/OrgUserRole'
        dateCreated:
          type: string
          description: Date when the organization was created
          format: date-time
        dateModified:
          type: string
          description: Date when the organization was last modified
          format: date-time
          nullable: true
        children:
          type: array
          items:
            $ref: '#/components/schemas/OrgTreeDetailDto'
          description: Child organizations under this organization
          nullable: true
      additionalProperties: false
    OrgTreeDto:
      type: object
      properties:
        orgId:
          type: string
          description: Organization's unique identifier
          format: uuid
        name:
          type: string
          description: Organization's name
          nullable: true
        parentOrgId:
          type: string
          description: Parent organization ID, if applicable
          format: uuid
          nullable: true
        children:
          type: array
          items:
            $ref: '#/components/schemas/OrgTreeDto'
          description: Child organizations under this organization
          nullable: true
      additionalProperties: false
    OrgUserCreateResponseDto:
      type: object
      properties:
        userId:
          type: string
          description: The ID of the user to be added to the organization
          nullable: true
        orgRole:
          $ref: '#/components/schemas/OrgUserRole'
        name:
          type: string
          description: User's name
          nullable: true
      additionalProperties: false
    OrgUserDeskDto:
      required:
        - orgId
        - userId
      type: object
      properties:
        userId:
          type: string
          description: The ID of the user to be added to the organization
          nullable: true
        orgRole:
          $ref: '#/components/schemas/OrgUserRole'
        name:
          type: string
          description: User's name
          nullable: true
        email:
          type: string
          description: User's email address
          nullable: true
        role:
          type: string
          description: User's role
          nullable: true
        orgId:
          type: string
          description: The ID of the organization
          nullable: true
        dateCreated:
          type: string
          description: The time when the user was added to this organization
          format: date-time
        dateModified:
          type: string
          description: >-
            The last time this user's settings were modified in this
            organization
          format: date-time
          nullable: true
      additionalProperties: false
    OrgUserDeskDtoCustomPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrgUserDeskDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
        skipCount:
          type: integer
          description: Number of items to skip
          format: int32
        maxResultCount:
          type: integer
          description: Maximum number of items to return
          format: int32
        totalPages:
          type: integer
          description: >-
            Total number of pages available based on the total count and max
            result count
          format: int32
          readOnly: true
      additionalProperties: false
    OrgUserDto:
      required:
        - userId
      type: object
      properties:
        id:
          type: string
          format: uuid
        orgId:
          type: string
          description: The ID of the organization
          format: uuid
        userId:
          type: string
          description: The ID of the user to be added to the organization
          nullable: true
        orgRole:
          $ref: '#/components/schemas/OrgUserRole'
        name:
          type: string
          description: User's name
          nullable: true
      additionalProperties: false
    OrgUserRole:
      enum:
        - super_admin
        - admin
        - operator_
        - viewer
      type: string
    PatDetailDto:
      type: object
      properties:
        clientCredentialId:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        clientId:
          type: string
          nullable: true
        clientSecret:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        expiredAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    PatDto:
      type: object
      properties:
        clientCredentialId:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        clientId:
          type: string
          nullable: true
        createdAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
        expiredAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
          nullable: true
        scopes:
          type: array
          items:
            type: string
          nullable: true
        deviceIds:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    RefreshGrantType:
      enum:
        - refresh_token
      type: string
    RemoteServiceErrorInfo:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        details:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: {}
          nullable: true
        validationErrors:
          type: array
          items:
            $ref: '#/components/schemas/RemoteServiceValidationErrorInfo'
          nullable: true
      additionalProperties: false
    RemoteServiceErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RemoteServiceErrorInfo'
      additionalProperties: false
    RemoteServiceValidationErrorInfo:
      type: object
      properties:
        message:
          type: string
          nullable: true
        members:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    Success:
      type: object
      additionalProperties: false
    TokenBodyDto:
      type: object
      properties:
        token:
          type: string
          nullable: true
        refreshToken:
          type: string
          nullable: true
      additionalProperties: false
    TokenResultDto:
      type: object
      properties:
        accessToken:
          type: string
          nullable: true
        refreshToken:
          type: string
          nullable: true
        expiresIn:
          type: integer
          format: int32
        tokenType:
          type: string
          nullable: true
      additionalProperties: false
    UpdateOrgResponseDto:
      type: object
      properties:
        orgId:
          type: string
          description: Organization's unique identifier
          format: uuid
        name:
          type: string
          description: Updated organization name
          nullable: true
        description:
          type: string
          description: Updated organization description
          nullable: true
        dateModified:
          type: string
          description: Last modification time in ISO 8601 format
          format: date-time
          nullable: true
      additionalProperties: false
    UpdateOrgUserByKeyDtoNoId:
      required:
        - orgRole
      type: object
      properties:
        orgRole:
          $ref: '#/components/schemas/OrgUserRole'
      additionalProperties: false
    ViewType:
      enum:
        - page
        - list
        - tree
      type: string
    BasicInfoDto:
      type: object
      properties:
        basicInfoId:
          type: string
          description: Node cache unique identifier
          format: uuid
        name:
          type: string
          description: Node name
          nullable: true
        type:
          $ref: '#/components/schemas/DeviceType'
        status:
          $ref: '#/components/schemas/EdgeSyncDeviceStatus'
        deviceId:
          type: string
          description: Node identifier (DeviceId or VirtualNodeId)
          nullable: true
        creationTime:
          type: string
          description: Node creation time
          format: date-time
      additionalProperties: false
      description: Node basic information cache data transfer object
    BasicInfoDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BasicInfoDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    BatchActionDto:
      required:
        - deviceId
        - taskId
      type: object
      properties:
        deviceId:
          minLength: 1
          type: string
        taskId:
          type: string
          format: uuid
      additionalProperties: false
    BatchActionLogDto:
      type: object
      properties:
        batchId:
          type: string
          description: Batch configuration id
          format: uuid
        taskId:
          type: string
          description: Task configuration id
          format: uuid
        deviceId:
          type: string
          description: Batch related device mac
          nullable: true
        sendTime:
          type: string
          description: Batch action send time
          format: date-time
        sendSuccess:
          type: boolean
          description: Batch execute result success or failed
        sendResultMessage:
          type: string
          description: Batch execute result message
          nullable: true
        executionResultId:
          type: string
          description: Batch execute result id
          nullable: true
        triggerId:
          type: string
          format: uuid
          nullable: true
        triggeredBy:
          type: string
          nullable: true
      additionalProperties: false
      description: Batch log data transfer object
    BatchDevicesDto:
      type: object
      properties:
        deviceIds:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    BatchDto:
      required:
        - cronExpression
      type: object
      properties:
        batchId:
          type: string
          format: uuid
        name:
          type: string
          description: Batch name
          nullable: true
        orgId:
          type: string
          nullable: true
        cronExpression:
          type: string
          description: Batch executed cron expression
          nullable: true
        isEnabled:
          type: boolean
          description: Batch enabled
        runOnStartup:
          type: boolean
          description: Batch run on service startup
        actions:
          type: array
          items:
            $ref: '#/components/schemas/BatchActionDto'
          description: Batch execute actions
          nullable: true
      additionalProperties: false
      description: Batch configuration
    BatchDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BatchDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    BatchResultGroupby:
      enum:
        - Trigger
      type: string
    BatchTriggerDto:
      type: object
      properties:
        triggerId:
          type: string
          format: uuid
          nullable: true
      additionalProperties: false
    BatchTriggerListResponseDto:
      type: object
      properties:
        triggerIds:
          type: array
          items:
            type: string
            format: uuid
          description: List of trigger IDs for the batch
          nullable: true
      additionalProperties: false
    CreateBatchActionDto:
      required:
        - deviceId
        - taskId
      type: object
      properties:
        deviceId:
          minLength: 1
          type: string
        taskId:
          type: string
          format: uuid
      additionalProperties: false
    CreateUpdateBatchByOrgIdDto:
      required:
        - actions
        - cronExpression
        - isEnabled
        - name
        - runOnStartup
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 1
          type: string
        cronExpression:
          minLength: 1
          type: string
        isEnabled:
          type: boolean
        runOnStartup:
          type: boolean
        actions:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/CreateBatchActionDto'
      additionalProperties: false
    CreateUpdateDeviceTaskByOrgIdDto:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 1
          type: string
        cmd:
          type: string
          description: Command will be executed
          nullable: true
        payload:
          type: string
          description: Variables in payload
          nullable: true
      additionalProperties: false
    DeviceCapContainerDto:
      type: object
      properties:
        image:
          type: string
          nullable: true
        resourceName:
          type: string
          nullable: true
        containerName:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapCpuDto:
      type: object
      properties:
        numOfCores:
          type: integer
          format: int32
        resourceName:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
        processorArchitecture:
          type: string
          nullable: true
        processorManufacturer:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapDataDto:
      type: object
      properties:
        deviceCapsDto:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapsDto'
          nullable: true
      additionalProperties: false
    DeviceCapDesiredDto:
      type: object
      additionalProperties: false
    DeviceCapDiskDto:
      type: object
      properties:
        diskType:
          type: string
          nullable: true
        totalSize:
          type: number
          format: double
        resourceName:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapMainboardExtensionDto:
      type: object
      properties:
        deviceId:
          type: string
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        sensorCount:
          type: integer
          format: int32
      additionalProperties: false
    DeviceCapNetworkInterfaceDto:
      type: object
      properties:
        macAddress:
          type: string
          nullable: true
        resourceName:
          type: string
          nullable: true
        interfaceType:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapRamDto:
      type: object
      properties:
        totalMemory:
          type: number
          format: double
        resourceName:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapReportedDto:
      type: object
      properties:
        osName:
          type: string
          nullable: true
        manufacturer:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        serialNumber:
          type: string
          nullable: true
        swVersion:
          type: string
          nullable: true
        timestamp:
          type: string
          nullable: true
        cpu:
          $ref: '#/components/schemas/DeviceCapCpuDto'
        ram:
          $ref: '#/components/schemas/DeviceCapRamDto'
        disks:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapDiskDto'
          nullable: true
        networkInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapNetworkInterfaceDto'
          nullable: true
        sensors:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapSensorDto'
          nullable: true
        subNodes:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapSubNodeDto'
          nullable: true
        containers:
          type: array
          items:
            $ref: '#/components/schemas/DeviceCapContainerDto'
          nullable: true
        mainboardExtension:
          $ref: '#/components/schemas/DeviceCapMainboardExtensionDto'
      additionalProperties: false
    DeviceCapResponseDto:
      type: object
      properties:
        cmd:
          type: string
          nullable: true
        seqId:
          type: integer
          format: int64
        reqSeqId:
          type: string
          nullable: true
        rspSeqId:
          type: string
          nullable: true
        timestamp:
          type: integer
          format: int64
        data:
          $ref: '#/components/schemas/DeviceCapDataDto'
      additionalProperties: false
    DeviceCapSensorDto:
      type: object
      properties:
        dtmi:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        resourceId:
          type: string
          nullable: true
        resourceShortId:
          type: string
          nullable: true
        deviceResourceId:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapShadowDataDto:
      type: object
      properties:
        reported:
          $ref: '#/components/schemas/DeviceCapReportedDto'
        desired:
          $ref: '#/components/schemas/DeviceCapDesiredDto'
      additionalProperties: false
    DeviceCapSubNodeDto:
      type: object
      properties:
        deviceId:
          type: string
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        deviceName:
          type: string
          nullable: true
        deviceType:
          type: string
          nullable: true
      additionalProperties: false
    DeviceCapsDto:
      type: object
      properties:
        creationTime:
          type: string
          format: date-time
        groupId:
          type: string
          nullable: true
        deviceId:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/DeviceCapShadowDataDto'
      additionalProperties: false
    DeviceCustomInfoDto:
      required:
        - deviceId
      type: object
      properties:
        deviceId:
          type: string
          description: Device id
          nullable: true
        key:
          type: string
          description: custom info key
          nullable: true
        value:
          type: string
          description: custom info value
          nullable: true
        datatype:
          type: string
          description: custom info data type
          nullable: true
      additionalProperties: false
      description: Device custom info
    DeviceCustomInfoPatchDto:
      type: object
      properties:
        value:
          type: string
          nullable: true
      additionalProperties: false
    DeviceDeactivated:
      enum:
        - deactivate
      type: string
    DeviceTaskDto:
      type: object
      properties:
        taskId:
          type: string
          description: ID
          format: uuid
        name:
          type: string
          description: Task name
          nullable: true
        orgId:
          type: string
          nullable: true
        cmd:
          type: string
          description: Command will be executed
          nullable: true
        payload:
          type: string
          description: Variables in payload
          nullable: true
      additionalProperties: false
      description: Task setting
    DeviceTaskDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DeviceTaskDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    DeviceType:
      enum:
        - WedaNode
        - SubNode
        - CustomDevice
      type: string
    EdgeSyncDeviceCreateDto:
      required:
        - deviceId
        - hwModel
      type: object
      properties:
        deviceId:
          type: string
          description: Device UID
          nullable: true
        hwModel:
          type: string
          description: Device hardware model
          nullable: true
      additionalProperties: false
      description: Device data transfer object
    EdgeSyncDeviceDto:
      required:
        - deviceId
        - hwModel
        - orgId
      type: object
      properties:
        deviceId:
          type: string
          description: Device id
          nullable: true
        hwModel:
          type: string
          description: Device hardware model
          nullable: true
        orgId:
          type: string
          description: Organization id
          nullable: true
        status:
          type: string
          description: Device current status.
          nullable: true
      additionalProperties: false
      description: Device data transfer object
    EdgeSyncDeviceGetResponseDto:
      required:
        - deviceId
        - hwModel
      type: object
      properties:
        deviceId:
          type: string
          description: Device id
          nullable: true
        hwModel:
          type: string
          description: Device hardware model
          nullable: true
        orgId:
          type: string
          description: Org id
          nullable: true
        status:
          type: string
          description: Device current status.
          nullable: true
        creationTime:
          type: string
          description: Device creation time.
          format: date-time
          nullable: true
      additionalProperties: false
      description: Device data transfer object
    EdgeSyncDeviceGetResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/EdgeSyncDeviceGetResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    EdgeSyncDeviceStatus:
      enum:
        - Registered
        - Activated
        - Deactivated
      type: string
    EdgeSyncDeviceUpdateRequestDto:
      type: object
      properties:
        orgId:
          type: string
          description: Organization ID
          nullable: true
      additionalProperties: false
      description: Payload to update device
    EdgeSyncDeviceUpdateResponseDto:
      required:
        - hwModel
      type: object
      properties:
        deviceId:
          type: string
          description: Device id
          nullable: true
        orgId:
          type: string
          description: Org id
          nullable: true
        hwModel:
          type: string
          description: Device hardware model
          nullable: true
        status:
          $ref: '#/components/schemas/EdgeSyncDeviceStatus'
      additionalProperties: false
      description: Device data transfer object
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ProvisionServiceType:
      enum:
        - MQTT
        - NATS
      type: string
    SensorInfo:
      required:
        - description
        - displayName
        - schema
      type: object
      properties:
        schema:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
      additionalProperties: false
    SubNodeDeviceConfigForEndUserDto:
      required:
        - deviceName
      type: object
      properties:
        enabled:
          type: boolean
          description: Indicates if all sub-nodes sensors are enabled
        deviceName:
          minLength: 1
          pattern: .*\S.*
          type: string
          description: Name of the device for identification
        sensors:
          type: array
          items:
            $ref: '#/components/schemas/SubNodeSensorConfigForUserDto'
          description: List of sensor configurations for the device
          nullable: true
      additionalProperties: false
    SubNodeSensorConfigForUserDto:
      type: object
      properties:
        name:
          type: string
          description: Unique identifier for the sensor (e.g., AI_0, DI_0, DO_0)
          nullable: true
        config:
          $ref: '#/components/schemas/SubNodeSensorRuntimeConfigForUserDto'
        sensorInfo:
          $ref: '#/components/schemas/SensorInfo'
      additionalProperties: false
    SubNodeSensorRuntimeConfigForUserDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: Indicates if the sensor is actively collecting data
        interval:
          type: integer
          description: Data collection interval in milliseconds (e.g., 1000 = 1 second)
          format: int32
      additionalProperties: false
    TriggeredByType:
      enum:
        - Manual
        - Scheduler
      type: string
    UpdateBatchActionsDto:
      required:
        - actions
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/CreateBatchActionDto'
      additionalProperties: false
    UpdateBatchIsEnabledDto:
      required:
        - isEnabled
      type: object
      properties:
        isEnabled:
          type: boolean
      additionalProperties: false
    AnalyticExpressionResponseDto:
      type: object
      properties:
        analyticExpressionId:
          type: string
          description: The unique identifier of the analytic expression.
          format: uuid
        name:
          type: string
          description: The name of the analytic expression.
          nullable: true
        description:
          type: string
          description: A description of the analytic expression.
          nullable: true
        type:
          $ref: '#/components/schemas/AnalyticExpressionType'
        schema:
          description: The JSON schema of the analytic expression.
          nullable: true
        category:
          type: string
          description: The category of the analytic expression.
          nullable: true
        tags:
          type: string
          description: Tags associated with the analytic expression.
          nullable: true
      additionalProperties: false
    AnalyticExpressionResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticExpressionResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    AnalyticExpressionType:
      enum:
        - BuiltIn
        - External
      type: string
    AnalyticModuleCreateRequest:
      required:
        - analyticExpressionId
        - configurations
        - name
        - type
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: A descriptive name for the analytic module.
        configurations:
          description: >-
            The configuration parameters for the analytic module, in JSON
            format.
        description:
          type: string
          description: A detailed description of the analytic module's purpose.
          nullable: true
        parentAnalyticModuleId:
          type: string
          description: >-
            The ID of the parent analytic module, if this module extends
            another.
          format: uuid
          nullable: true
        type:
          $ref: '#/components/schemas/AnalyticModuleType'
        analyticExpressionId:
          type: string
          description: The ID of the analytic expression associated with this module.
          format: uuid
      additionalProperties: false
    AnalyticModuleDto:
      required:
        - type
      type: object
      properties:
        analyticModuleId:
          type: string
          description: The unique identifier of the analytic module setting.
          format: uuid
        name:
          type: string
          description: Name of this analytic module setting
          nullable: true
        configurations:
          type: object
          additionalProperties: {}
          description: Configurations of this analytic module setting
          nullable: true
        schemas:
          type: object
          additionalProperties: {}
          description: >-
            Schemas of this analytic module setting. Define properties in
            configurations.
          nullable: true
        type:
          $ref: '#/components/schemas/AnalyticModuleType'
        isSystem:
          type: boolean
          description: Indicates whether this analytic module setting is a system module.
      additionalProperties: false
    AnalyticModuleItem:
      type: object
      properties:
        analyticModuleId:
          type: string
          format: uuid
          nullable: true
        analyticModuleName:
          type: string
          nullable: true
      additionalProperties: false
    AnalyticModuleResponseDto:
      type: object
      properties:
        analyticModuleId:
          type: string
          description: The unique identifier of the analytic module.
          format: uuid
        name:
          type: string
          description: The name of the analytic module.
          nullable: true
        configurations:
          description: The configuration of the analytic module.
          nullable: true
        description:
          type: string
          description: A description of the analytic module.
          nullable: true
        parentAnalyticModuleId:
          type: string
          description: The ID of the parent analytic module.
          format: uuid
          nullable: true
        type:
          $ref: '#/components/schemas/AnalyticModuleType'
        analyticExpressionId:
          type: string
          description: The ID of the associated analytic expression.
          format: uuid
      additionalProperties: false
    AnalyticModuleResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    AnalyticModuleType:
      enum:
        - LocalExecution
        - InternetComputing
      type: string
    AnalyticModuleUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: The updated name for the analytic module.
          nullable: true
        configurations:
          description: The updated configuration for the analytic module.
          nullable: true
        description:
          type: string
          description: The updated description for the analytic module.
          nullable: true
        parentAnalyticModuleId:
          type: string
          description: The updated parent analytic module ID.
          format: uuid
          nullable: true
        type:
          $ref: '#/components/schemas/AnalyticModuleType'
        analyticExpressionId:
          type: string
          description: The updated analytic expression ID.
          format: uuid
          nullable: true
      additionalProperties: false
    CustomDeviceAggregateDto:
      type: object
      properties:
        deviceId:
          type: string
          description: The unique identifier of the custom deivce.
          format: uuid
        name:
          type: string
          description: The name of the custom deivce.
          nullable: true
        status:
          $ref: '#/components/schemas/VirtualDeviceStatus'
        sketch:
          $ref: '#/components/schemas/CustomDeviceSketchDto'
        blueprint:
          $ref: '#/components/schemas/CustomDeviceBlueprintDto'
      additionalProperties: false
    CustomDeviceBlueprintDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the custom deivce blueprint.
          nullable: true
        description:
          type: string
          description: The description of the custom deivce blueprint.
          nullable: true
        dataSource:
          $ref: '#/components/schemas/DataSourceDto'
        dataParser:
          $ref: '#/components/schemas/DataParserDto'
        analyticModules:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleDto'
          description: The analytic modules associated with the custom deivce blueprint.
          nullable: true
      additionalProperties: false
    CustomDeviceBlueprintResponseDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the custom deivce blueprint.
          nullable: true
        description:
          type: string
          description: The description of the custom deivce blueprint.
          nullable: true
        dataSource:
          $ref: '#/components/schemas/DataSourceDto'
        dataParser:
          $ref: '#/components/schemas/DataParserDto'
        analyticModules:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleDto'
          description: The analytic modules associated with the custom deivce blueprint.
          nullable: true
      additionalProperties: false
    CustomDeviceCreateRequest:
      required:
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: The name for the new custom deivce.
      additionalProperties: false
    CustomDeviceResponseDto:
      type: object
      properties:
        deviceId:
          type: string
          description: The unique identifier of the custom deivce.
          format: uuid
        name:
          type: string
          description: The name of the custom deivce.
          nullable: true
        status:
          $ref: '#/components/schemas/VirtualDeviceStatus'
      additionalProperties: false
    CustomDeviceSketchDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the custom deivce sketch.
          nullable: true
        description:
          type: string
          description: The description of the custom deivce sketch.
          nullable: true
        dataSource:
          $ref: '#/components/schemas/DataSourceDto'
        dataParser:
          $ref: '#/components/schemas/DataParserDto'
        analyticModules:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleDto'
          description: The analytic modules associated with the custom deivce sketch.
          nullable: true
      additionalProperties: false
    CustomDeviceSketchResponseDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the custom deivce sketch.
          nullable: true
        description:
          type: string
          description: The description of the custom deivce sketch.
          nullable: true
        dataSource:
          $ref: '#/components/schemas/DataSourceDto'
        dataParser:
          $ref: '#/components/schemas/DataParserDto'
        analyticModules:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleDto'
          description: The analytic modules associated with the custom deivce sketch.
          nullable: true
      additionalProperties: false
    CustomDeviceTemplateCreateRequest:
      required:
        - analyticModuleIds
        - dataParserId
        - dataSourceId
        - name
        - type
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: The name of the custom deivce template.
        description:
          type: string
          description: A description of the custom deivce template.
          nullable: true
        type:
          $ref: '#/components/schemas/VirtualDeviceTemplateType'
        dataSourceId:
          type: string
          description: The ID of the data source to be used in the template.
          format: uuid
        dataParserId:
          type: string
          description: The ID of the data parser to be used in the template.
          format: uuid
        analyticModuleIds:
          minItems: 1
          type: array
          items:
            type: string
            format: uuid
          description: The IDs of the analytic modules to be used in the template.
      additionalProperties: false
    CustomDeviceTemplatePageResponseDto:
      type: object
      properties:
        templateId:
          type: string
          description: The unique identifier of the custom deivce template.
          format: uuid
        name:
          type: string
          description: The name of the custom deivce template.
          nullable: true
        description:
          type: string
          description: A description of the custom deivce template.
          nullable: true
        type:
          $ref: '#/components/schemas/VirtualDeviceTemplateType'
        stage:
          $ref: '#/components/schemas/VirtualDeviceTemplateStage'
      additionalProperties: false
    CustomDeviceTemplatePageResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CustomDeviceTemplatePageResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    CustomDeviceTemplateResponseDto:
      type: object
      properties:
        templateId:
          type: string
          description: The unique identifier of the custom deivce template.
          format: uuid
        name:
          type: string
          description: The name of the custom deivce template.
          nullable: true
        description:
          type: string
          description: A description of the custom deivce template.
          nullable: true
        type:
          $ref: '#/components/schemas/VirtualDeviceTemplateType'
        stage:
          $ref: '#/components/schemas/VirtualDeviceTemplateStage'
        dataSourceId:
          type: string
          description: The ID of the data source used in the template.
          format: uuid
          nullable: true
        dataSourceName:
          type: string
          description: The name of the data source used in the template.
          nullable: true
        dataParserId:
          type: string
          description: The ID of the data parser used in the template.
          format: uuid
          nullable: true
        dataParserName:
          type: string
          description: The name of the data parser used in the template.
          nullable: true
        analyticModules:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticModuleItem'
          description: The list of analytic modules used in the template.
          nullable: true
      additionalProperties: false
    CustomDeviceTemplateUpdateRequest:
      required:
        - analyticModuleIds
        - dataParserId
        - dataSourceId
        - name
        - type
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: The updated name for the custom deivce template.
        description:
          type: string
          description: The updated description for the custom deivce template.
          nullable: true
        type:
          $ref: '#/components/schemas/VirtualDeviceTemplateType'
        dataSourceId:
          type: string
          description: The updated data source ID.
          format: uuid
        dataParserId:
          type: string
          description: The updated data parser ID.
          format: uuid
        analyticModuleIds:
          minItems: 1
          type: array
          items:
            type: string
            format: uuid
          description: The updated analytic module IDs.
      additionalProperties: false
    DataConnectorResponseDto:
      type: object
      properties:
        dataConnectorId:
          type: string
          description: The unique identifier of the data connector.
          format: uuid
        name:
          type: string
          description: The user-defined name for the data connector.
          nullable: true
        description:
          type: string
          description: A description of the data connector's purpose.
          nullable: true
        type:
          $ref: '#/components/schemas/DataConnectorType'
        schema:
          description: >-
            The JSON schema that defines the configuration properties for this
            data connector.
          nullable: true
        contents:
          type: string
          description: The binary content (e.g., a DLL) of the data connector.
          format: byte
          nullable: true
      additionalProperties: false
    DataConnectorResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DataConnectorResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    DataConnectorType:
      enum:
        - NATS
        - MQTT
        - HTTP
        - WedaPQ
      type: string
    DataParserConfigurationDto:
      required:
        - mappings
        - sourceType
      type: object
      properties:
        sourceType:
          $ref: '#/components/schemas/DataParserSourceType'
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/MappingRuleDto'
          description: The mapping rules defining how to extract and transform data fields.
      additionalProperties: false
    DataParserCreateRequest:
      required:
        - configurations
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: A descriptive name for the data parser.
        description:
          type: string
          description: A detailed description of the data parser.
          nullable: true
        configurations:
          $ref: '#/components/schemas/DataParserConfigurationDto'
      additionalProperties: false
    DataParserDataType:
      enum:
        - Number
        - String
        - Boolean
        - DateTime
        - Image
        - ImageMetadata
      type: string
    DataParserDto:
      type: object
      properties:
        dataParserId:
          type: string
          description: The unique identifier of the data parser setting.
          format: uuid
        name:
          type: string
          description: Name of this data parser setting
          nullable: true
        configurations:
          $ref: '#/components/schemas/DataParserConfigurationDto'
        isSystem:
          type: boolean
          description: Indicates whether this data parser setting is a system parser.
      additionalProperties: false
    DataParserResponseDto:
      type: object
      properties:
        dataParserId:
          type: string
          description: The unique identifier of the data parser.
          format: uuid
        name:
          type: string
          description: A descriptive name for the data parser.
          nullable: true
        description:
          type: string
          description: A detailed description of the data parser.
          nullable: true
        configurations:
          $ref: '#/components/schemas/DataParserConfigurationDto'
      additionalProperties: false
    DataParserResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DataParserResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    DataParserSourceType:
      enum:
        - JSON
      type: string
    DataParserUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: The updated name for the data parser.
          nullable: true
        description:
          type: string
          description: The updated description for the data parser.
          nullable: true
        configurations:
          $ref: '#/components/schemas/DataParserConfigurationDto'
      additionalProperties: false
    DataSourceCreateRequest:
      required:
        - configurations
        - dataConnectorId
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: A descriptive name for the data source.
        description:
          type: string
          description: A detailed description of the data source.
          nullable: true
        configurations:
          description: >-
            The configuration parameters for the data source, which depend on
            the data connector type.
        dataConnectorId:
          type: string
          description: >-
            The unique identifier of the data connector to be used by this data
            source.
          format: uuid
      additionalProperties: false
    DataSourceDto:
      required:
        - type
      type: object
      properties:
        dataSourceId:
          type: string
          description: The unique identifier of the data source setting.
          format: uuid
        dll:
          type: string
          description: Executable dll file
          format: byte
          nullable: true
        name:
          type: string
          description: Name of this data source setting
          nullable: true
        configurations:
          type: object
          additionalProperties: {}
          description: Configurations for data source setting
          nullable: true
        schemas:
          type: object
          additionalProperties: {}
          description: Schemas to define parameters in configurations
          nullable: true
        type:
          $ref: '#/components/schemas/DataConnectorType'
        isSystem:
          type: boolean
          description: Indicates whether this data source setting is a system source.
      additionalProperties: false
    DataSourceResponseDto:
      type: object
      properties:
        dataSourceId:
          type: string
          description: The unique identifier for the data source.
          format: uuid
        name:
          type: string
          description: The name of the data source.
          nullable: true
        description:
          type: string
          description: A description of the data source.
          nullable: true
        configurations:
          description: The configuration of the data source.
          nullable: true
        dataConnectorId:
          type: string
          description: The ID of the associated data connector.
          format: uuid
      additionalProperties: false
    DataSourceResponseDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DataSourceResponseDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    DataSourceUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: The updated name for the data source.
          nullable: true
        description:
          type: string
          description: The updated description for the data source.
          nullable: true
        configurations:
          description: The updated configuration for the data source.
          nullable: true
        dataConnectorId:
          type: string
          description: The updated data connector ID.
          format: uuid
          nullable: true
      additionalProperties: false
    ImageUploadCreatedResponse:
      type: object
      properties:
        object_id:
          type: string
          nullable: true
        bucket:
          type: string
          nullable: true
        object_key:
          type: string
          nullable: true
        etag:
          type: string
          nullable: true
        content_length:
          type: integer
          format: int64
        captured_at_ms:
          type: integer
          format: int64
        received_at_ms:
          type: integer
          format: int64
      additionalProperties: false
    MappingRuleDto:
      required:
        - dataType
        - sourcePath
        - targetField
      type: object
      properties:
        sourcePath:
          minLength: 1
          type: string
          description: The JSON path to the source data field.
        timePath:
          type: string
          description: The JSON path to the time field.
          nullable: true
        targetField:
          minLength: 1
          type: string
          description: The target field name in the parsed output.
        dataType:
          $ref: '#/components/schemas/DataParserDataType'
        deviceId:
          type: string
          description: The device ID to WedaPQ (optional).
          nullable: true
        cpq:
          type: string
          description: The CPQ value to WedaPQ (optional).
          nullable: true
      additionalProperties: false
    VirtualDeviceSketchUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: The updated name of the custom deivce sketch.
          nullable: true
        description:
          type: string
          description: The updated description of the custom deivce sketch.
          nullable: true
        dataSourceId:
          type: string
          description: The updated data source ID.
          format: uuid
          nullable: true
        dataParserId:
          type: string
          description: The updated data parser ID.
          format: uuid
          nullable: true
        analyticModuleIds:
          type: array
          items:
            type: string
            format: uuid
          description: The updated analytic module IDs.
          nullable: true
      additionalProperties: false
    VirtualDeviceStatus:
      enum:
        - Registered
        - Activated
        - Deactivated
        - Terminated
      type: string
    VirtualDeviceTemplateStage:
      enum:
        - Unpublished
        - Published
      type: string
    VirtualDeviceTemplateType:
      enum:
        - BuiltIn
        - Custom
      type: string
    VirtualDeviceUpdateRequest:
      required:
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: The updated name for the custom deivce.
      additionalProperties: false
    CommandExecutionResultCacheDto:
      type: object
      properties:
        deviceId:
          type: string
          description: The unique identifier of the device that executed the command.
          nullable: true
        seqId:
          type: integer
          description: >-
            Sequential identifier of the original command request that was
            executed.
          format: int64
        reqSeqId:
          type: string
          description: >-
            Unique request sequence identifier from the original command for
            correlation.
          nullable: true
        rspSeqId:
          type: string
          description: >-
            Unique response sequence identifier generated by the device for this
            execution result.
          nullable: true
        cmd:
          type: string
          description: >-
            The command type identifier. Default value is "deviceCmd" for device
            commands.
          nullable: true
        data:
          $ref: '#/components/schemas/CommandExecutionResultDataCacheDto'
      additionalProperties: false
      description: >-
        Data transfer object representing the cached result of a command
        execution on an edge device.

        Contains both the command metadata and execution result data for
        tracking and correlation purposes.
    CommandExecutionResultDataCacheDto:
      type: object
      properties:
        deviceCmd:
          type: string
          description: >-
            The specific device command that was executed.

            Possible values include: stack, stack.start, stack.stop,
            stack.restart, stack.pause, stack.resume
          nullable: true
        status:
          type: integer
          description: >-
            The execution status code indicating success or failure.

            Typically follows HTTP status code conventions (e.g., 200 for
            success, 400+ for errors).
          format: int32
        message:
          type: string
          description: >-
            Human-readable message describing the execution result, error
            details, or status information.
          nullable: true
        resultData:
          type: object
          additionalProperties: {}
          description: >-
            Additional result data produced by the command execution, such as
            container states,

            stack information, or error details in key-value format.
          nullable: true
        executedAt:
          type: string
          description: >-
            ISO 8601 format timestamp indicating when the command execution
            began on the device.
          nullable: true
        completedAt:
          type: string
          description: >-
            ISO 8601 format timestamp indicating when the command execution
            completed on the device.
          nullable: true
      additionalProperties: false
      description: >-
        Contains the detailed execution result data for a device command,
        including status,

        timing information, and any result data produced during execution.
    CommandRequest:
      type: object
      properties:
        stackConfigId:
          type: string
          description: An unique ID for the stack configuration.
          format: uuid
      additionalProperties: false
      description: >-
        Represents a command request for container stack operations on edge
        devices.
    ContainerDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the container, typically the Docker container
            ID.
          nullable: true
        name:
          type: string
          description: Name of the container as defined in the Docker Compose file.
          nullable: true
        state:
          $ref: '#/components/schemas/ContainerState'
        error:
          $ref: '#/components/schemas/ContainerErrorDto'
      additionalProperties: false
      description: >-
        Identifies a container instance within a deployed stack and reports its
        current runtime state.
    ContainerErrorDto:
      type: object
      properties:
        code:
          type: string
          description: |-
            Error code identifying the type of error. Common values include
            `OOMKilled`, `ImagePullBackOff`, `ErrImagePull`, `CrashLoopBackOff`,
            `ContainerCannotRun`, `Created`, `Unhealthy`. Treat unknown codes as
            informational and rely on `message` / `details` for context.
          nullable: true
        message:
          type: string
          description: Human-readable error message describing the issue.
          nullable: true
        timestamp:
          type: string
          description: UTC timestamp (ISO 8601) when the error was observed by the device.
          format: date-time
        details:
          type: object
          additionalProperties: {}
          description: >-
            Additional error details and context (e.g., `exitCode`, `image`,

            `container`, `logSnippet`). Schema is intentionally open — keys
            depend

            on the error `code`.
          nullable: true
      additionalProperties: false
      description: >-
        Structured error information for a container, as last reported by the
        device.
    ContainerStackDto:
      type: object
      properties:
        stackConfigId:
          type: string
          description: >-
            Unique identifier for the stack series, used for grouping different
            versions of the same stack.
          format: uuid
        stackRevisionId:
          type: string
          description: Unique identifier for this specific stack version.
          format: uuid
        stackName:
          type: string
          description: Name of the container stack. Must be unique across all versions.
          nullable: true
        type:
          type: string
          description: Type of the container stack (e.g., "compose" for Docker Compose).
          nullable: true
        composeFileContent:
          type: string
          description: Base64 encoded Docker Compose file content.
          nullable: true
        environment:
          type: object
          additionalProperties: {}
          description: Environment variables and configuration parameters for the stack.
          nullable: true
        description:
          type: string
          description: Description of the container stack.
          nullable: true
        creationTime:
          type: string
          description: The creation time of the container stack.
          format: date-time
        orgId:
          type: string
          description: Organization id
          format: uuid
        version:
          type: integer
          description: |-
            Auto-incremented version number of this stack revision. 
            The combination of stack-name and version should be unique.
          format: int32
      additionalProperties: false
      description: >-
        Data transfer object representing a container stack with its
        configuration and runtime information.

        Used for transferring stack data between API endpoints and client
        applications.
    ContainerState:
      enum:
        - unknown
        - created
        - running
        - paused
        - restarting
        - removing
        - exited
        - dead
        - unhealthy
        - error
      type: string
      description: >-
        Runtime state of a single container, as reported by the device.
                    
        - `unknown`: State could not be determined or the device did not report
        a recognized value.

        - `created`: Container has been created but not yet started. Transient —
        the daemon has provisioned the container but the entrypoint has not run.

        - `running`: Container process is up. Healthy steady state.

        - `paused`: Container is paused (SIGSTOP-equivalent). Set by
        `stack.pause`.

        - `restarting`: Container is being restarted, typically by the restart
        policy. Repeated visits here while `restartCount` climbs indicate
        flapping.

        - `removing`: Container is being torn down. Transient; expected during
        undeploy / update / device reset.

        - `exited`: Container process has terminated. Inspect
        `errors[].details.exitCode` (when populated) to classify clean exit vs
        crash.

        - `dead`: Daemon could not stop the container cleanly and has marked it
        as dead. Operator intervention required (typically `docker rm -f` on the
        device, or device reset).

        - `unhealthy`: Healthcheck has reported failure. Container is up but not
        serving.

        - `error`: Generic error state reported by the agent when the daemon
        returns a non-standard state. Read `reason` at the deployment level for
        context.
    CreateContainerStackDto:
      required:
        - composeFileContent
        - stackName
        - type
      type: object
      properties:
        stackName:
          maxLength: 63
          minLength: 1
          type: string
          description: Name of the container stack to create.
          default: my-first-stack
        type:
          minLength: 1
          type: string
          description: |-
            Type of the container stack deployment.
            value : compose
          format: Enumeration
          default: compose
        composeFileContent:
          minLength: 1
          type: string
          description: Base64 encoded Docker Compose file content.
          default: >-
            dmVyc2lvbjogIjMuOCIKc2VydmljZXM6CiAgbmdpbng6CiAgICBpbWFnZTogbmdpbng6bGF0ZXN0CiAgICBwb3J0czoKICAgICAgLSAiODA6ODAiCiAgICB2b2x1bWVzOgogICAgICAtIC4vaHRtbDovdXNyL3NoYXJlL25naW54L2h0bWw=
        environment:
          type: object
          additionalProperties: {}
          description: Environment variables and configuration parameters for the stack.
          nullable: true
        description:
          type: string
          description: Description of the container stack.
          nullable: true
      additionalProperties: false
      description: Data transfer object for creating a new container stack.
    CreateRegistryDto:
      required:
        - registryCredentials
        - registryName
        - registryUrl
      type: object
      properties:
        registryName:
          maxLength: 32
          minLength: 0
          type: string
          description: Name of the registry. Must be unique within the organization.
          default: harbor-ecr-sync
        registryUrl:
          minLength: 1
          type: string
          description: URL of the container registry.
          format: uri
          default: https://registry.dev.company.com
        registryCredentials:
          $ref: '#/components/schemas/RegistryCredentials'
      additionalProperties: false
      description: >-
        Data transfer object for creating a new container registry
        configuration.
    CreateUpdateStackDeploymentsDto:
      required:
        - deviceIds
      type: object
      properties:
        deviceIds:
          maxItems: 128
          minItems: 1
          type: array
          items:
            type: string
          description: List of device identifiers to deploy the stack to.
      additionalProperties: false
      description: >-
        Data transfer object for deploying a container stack to multiple devices
        simultaneously.
    EncryptedCredentials:
      type: object
      additionalProperties: false
    PagedResultDto  of  CommandExecutionResultCacheDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CommandExecutionResultCacheDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    PagedResultDto  of  ContainerStackDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ContainerStackDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    PagedResultDto  of  RegistryDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RegistryDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    RegistryCredentials:
      type: object
      additionalProperties: false
    RegistryDto:
      type: object
      properties:
        registryId:
          type: string
          description: Identifier of the registry.
          format: uuid
        registryName:
          type: string
          description: Name of the registry. Must be unique within the organization.
          nullable: true
        registryUrl:
          type: string
          description: URL of the container registry.
          nullable: true
        creationTime:
          type: string
          description: The creation time of the registry.
          format: date-time
        registryEncryptedCredentials:
          $ref: '#/components/schemas/EncryptedCredentials'
        orgId:
          type: string
          nullable: true
      additionalProperties: false
      description: Data transfer object representing a container registry configuration.
    StackAction:
      enum:
        - start
        - stop
        - pause
        - resume
        - restart
      type: string
    StackDeploymentDto:
      type: object
      properties:
        stackConfigId:
          type: string
          description: >-
            Unique identifier for the stack series, used for grouping different
            versions of the same stack.
          format: uuid
        stackRevisionId:
          type: string
          description: Gets or sets the unique identifier for the deployment revision.
          format: uuid
        deploymentId:
          type: string
          description: Gets or sets the unique identifier for the deployment.
          format: uuid
        taskId:
          type: string
          description: Gets or sets the unique identifier for the deployment task.
          format: uuid
        stackName:
          type: string
          description: Gets or sets the name of the stack being deployed.
          nullable: true
        deviceId:
          type: string
          description: Gets or sets the identifier of the target device for deployment.
          nullable: true
        version:
          type: string
          description: Gets or sets the version of the stack being deployed.
          nullable: true
        status:
          $ref: '#/components/schemas/StackDeploymentStatus'
        containers:
          type: array
          items:
            $ref: '#/components/schemas/ContainerDto'
          description: >-
            Gets or sets the collection of containers that are part of this
            stack deployment.
          nullable: true
        error:
          type: object
          additionalProperties: {}
          description: >-
            Gets or sets the error information if the deployment encountered any
            issues.

            Contains key-value pairs with error details.
          nullable: true
        operationAction:
          type: string
          nullable: true
        operationStatus:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
        active:
          type: boolean
          description: >-
            Gets or sets a value indicating whether this deployment is currently
            active.
        creationTime:
          type: string
          format: date-time
      additionalProperties: false
      description: >-
        Data Transfer Object representing a stack deployment with its associated
        containers, status, and metadata.
    StackDeploymentStatus:
      enum:
        - unknown
        - pending
        - deploying
        - awaitingDeployedStatus
        - running
        - deployed
        - completed
        - exited
        - paused
        - stopped
        - removing
        - awaitingRemovedStatus
        - awaitingCleanup
        - retry
        - error
      type: string
      description: >-
        Aggregate lifecycle status of a stack deployment on a device.
                    
        - `unknown`: Status could not be determined or the device reported a
        value that is not in the documented set.

        - `pending`: Agent has accepted the desired state but has not yet
        started any pipeline phase. Transient — set when a new revision is
        queued or an existing stack is marked for update or removal.

        - `deploying`: A pipeline phase is in flight: validating the compose,
        pulling images, or running compose-up.

        - `awaitingDeployedStatus`: Compose-up has completed; the agent is
        polling the deployer for `running` (or `completed` for one-shot stacks).

        - `running`: At least one container in the stack is up. Steady-state
        running stack.

        - `deployed`: All declared services have been started successfully — the
        stack is fully up.

        - `completed`: The stack ran to completion (one-shot stacks, e.g. an
        updater job).

        - `exited`: All containers in the stack have exited. Inspect each
        container's `error` field — non-zero exit codes (e.g. `OOMKilled`,
        `exitCode 137`) indicate a crash; a clean exit on a one-shot stack is
        closer to `completed`.

        - `paused`: All containers in the stack are paused. Set after a
        successful `stack.pause` runtime command. Resume with `POST
        .../commands:resume`.

        - `stopped`: All containers in the stack are stopped (containers exist
        but are not running). Set after a successful `stack.stop` runtime
        command. Start with `POST .../commands:start`.

        - `removing`: The agent is tearing the stack down (compose-down). Set
        during `deleteStack` (undeploy or device reset).

        - `awaitingRemovedStatus`: Compose-down has completed; the agent is
        polling for `removed`.

        - `awaitingCleanup`: The deployer reported `removed`; the agent is now
        removing the stack's local files and bookkeeping. After cleanup the
        deployment record is deleted and the stack disappears from the
        device-stacks listing.

        - `retry`: A pipeline phase failed transiently; the agent has scheduled
        an exponential-backoff retry. If `retry` persists indefinitely, treat as
        a partial failure and inspect `reason`.

        - `error`: A pipeline phase failed. Covers both transient (agent will
        keep retrying) and terminal failures (auth denied, manifest unknown,
        malformed YAML, port collision, platform mismatch). Read `reason` and
        the agent's `retryStopped` projection to disambiguate.
    StackDeploymentsDto:
      type: object
      properties:
        stackDeployments:
          type: array
          items:
            $ref: '#/components/schemas/StackDeploymentDto'
          description: The list of individual stack deployments.
          nullable: true
        totalDevices:
          type: integer
          description: The total number of devices involved in the deployment process.
          format: int32
        skippedDevices:
          type: integer
          description: The number of devices that were skipped during deployment.
          format: int32
        newlyDeployedDevices:
          type: integer
          description: The number of devices that received new deployments.
          format: int32
        deviceActions:
          type: object
          additionalProperties:
            type: string
          description: >-
            A dictionary that maps each device ID to its corresponding action
            (skip/update/add).

            The key is the device ID and the value is the action performed on
            that device.
          nullable: true
      additionalProperties: false
      description: >-
        Data Transfer Object representing a collection of stack deployments.

        Provides the batch deployment result, including overall statistics and a
        detailed action summary (DeviceActions dictionary) for each device.

        The device actions are mapped maintaining the same order as the input
        DeviceIds.
    UpdateRegistryDto:
      required:
        - registryName
        - registryUrl
      type: object
      properties:
        registryName:
          maxLength: 32
          minLength: 0
          type: string
          description: Name of the registry. Must be unique within the organization.
        registryUrl:
          minLength: 1
          type: string
          description: URL of the container registry.
          format: uri
        registryCredentials:
          $ref: '#/components/schemas/RegistryCredentials'
      additionalProperties: false
      description: >-
        Data transfer object for updating an existing container registry
        configuration.
    UpdateStackDto:
      type: object
      properties:
        composeFileContent:
          type: string
          description: Base64 encoded Docker Compose file content for the new version.
          default: c2VydmljZXM6CiAgdGVzdDoKICAgIGltYWdlOiB0ZXN0
          nullable: true
        environment:
          type: object
          additionalProperties: {}
          description: >-
            Environment variables and configuration parameters for the new stack
            version.
          nullable: true
        description:
          type: string
          description: Description of the container stack.
          nullable: true
      additionalProperties: false
      description: >-
        Data transfer object for updating an existing container stack by
        creating a new version.
    AttachmentDto:
      type: object
      properties:
        filename:
          type: string
          nullable: true
        contentType:
          type: string
          nullable: true
      additionalProperties: false
    ChannelDetailDto:
      type: object
      properties:
        channelId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        channelName:
          type: string
          nullable: true
          writeOnly: true
        channelType:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        isEnabled:
          type: boolean
        enabled:
          type: boolean
          writeOnly: true
        commonSettings:
          $ref: '#/components/schemas/CommonSettingsDto'
        config:
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/ChannelRecipientDto'
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        templateId:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    ChannelListItemDto:
      type: object
      properties:
        channelId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        channelName:
          type: string
          nullable: true
          writeOnly: true
        channelType:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        isEnabled:
          type: boolean
        enabled:
          type: boolean
          writeOnly: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    ChannelListItemDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChannelListItemDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    ChannelRecipientDto:
      required:
        - target
      type: object
      properties:
        name:
          type: string
          nullable: true
        target:
          minLength: 1
          type: string
        type:
          type: string
          nullable: true
      additionalProperties: false
    ChannelStatusResponseDto:
      type: object
      properties:
        channelId:
          type: string
          nullable: true
        isEnabled:
          type: boolean
        enabled:
          type: boolean
          writeOnly: true
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    ChannelType:
      enum:
        - email
        - teams
        - linemessage
        - webhook
      type: string
    ChannelTypeDetailDto:
      type: object
      properties:
        channelType:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
        configSchema:
          nullable: true
        examples:
          type: array
          items: {}
          nullable: true
      additionalProperties: false
    ChannelTypeDto:
      type: object
      properties:
        channelType:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
      additionalProperties: false
    ChannelTypeDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChannelTypeDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    ChannelUpdateStatusRequest:
      required:
        - isEnabled
      type: object
      properties:
        isEnabled:
          type: boolean
      additionalProperties: false
    CommonSettingsDto:
      type: object
      properties:
        timeout:
          maximum: 300000
          minimum: 0
          type: integer
          format: int32
          nullable: true
        retryAttempts:
          maximum: 10
          minimum: 0
          type: integer
          format: int32
          nullable: true
        retryDelay:
          maximum: 60000
          minimum: 0
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
    CreateChannelDto:
      required:
        - channelType
        - config
        - name
      type: object
      properties:
        name:
          maxLength: 100
          minLength: 1
          pattern: ^\S+$
          type: string
        channelType:
          $ref: '#/components/schemas/ChannelType'
        description:
          maxLength: 500
          type: string
          nullable: true
        isEnabled:
          type: boolean
        commonSettings:
          $ref: '#/components/schemas/CommonSettingsDto'
        config:
          description: >-
            Channel-type-specific configuration object. Structure depends on
            channelType:


            **email**: `{ host* (string), port* (1-65535), username* (string),
            password* (string), senderEmail* (email), senderName (string),
            secure (bool) }`


            **teams**: `{ url* (URL) }`


            **linemessage**: `{ accessToken* (string), sendMode* ('push' |
            'multicast') }`


            **webhook**: `{ url* (URL), method*
            ('GET'|'POST'|'PUT'|'PATCH'|'DELETE'), contentType*
            ('applicationJson'|'applicationFormUrlEncoded'|'textPlain') }`


            Fields marked with * are required.
        templateId:
          type: string
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/ChannelRecipientDto'
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    CreateTemplateDto:
      required:
        - channelTypes
        - content
        - name
      type: object
      properties:
        name:
          maxLength: 200
          minLength: 1
          type: string
        subject:
          maxLength: 500
          type: string
          nullable: true
        content:
          maxLength: 50000
          minLength: 1
          type: string
        channelTypes:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    FunctionTransferCreateRequest:
      required:
        - dataObjectName
        - type
      type: object
      properties:
        dataObjectName:
          minLength: 1
          type: string
        expression:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/FunctionTransferType'
      additionalProperties: false
    FunctionTransferDto:
      type: object
      properties:
        transferFunctionId:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        dataObjectName:
          type: string
          nullable: true
        expression:
          type: string
          nullable: true
        isEnabled:
          type: boolean
        creationTime:
          type: string
          format: date-time
        lastModificationTime:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    FunctionTransferDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/FunctionTransferDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    FunctionTransferType:
      enum:
        - Expression
      type: string
    FunctionTransferUpdateRequest:
      type: object
      properties:
        expression:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/FunctionTransferType'
        isEnabled:
          type: boolean
          nullable: true
      additionalProperties: false
    FunctionTransferUpdateStatusRequest:
      required:
        - isEnabled
      type: object
      properties:
        isEnabled:
          type: boolean
      additionalProperties: false
    MessageDetailDto:
      type: object
      properties:
        messageId:
          type: string
          nullable: true
        channelIds:
          type: array
          items:
            type: string
          nullable: true
        templateId:
          type: string
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/RecipientDto'
          nullable: true
        subject:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
        variables:
          type: object
          additionalProperties: {}
          nullable: true
        status:
          $ref: '#/components/schemas/MessageStatus'
        results:
          type: array
          items:
            $ref: '#/components/schemas/MessageResultDto'
          nullable: true
        successCount:
          type: integer
          format: int32
        failureCount:
          type: integer
          format: int32
        totalCount:
          type: integer
          format: int32
        settings:
          $ref: '#/components/schemas/MessageSettingsDto'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentDto'
          nullable: true
        sentAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
      additionalProperties: false
    MessageListItemDto:
      type: object
      properties:
        messageId:
          type: string
          nullable: true
        channelIds:
          type: array
          items:
            type: string
          nullable: true
        status:
          $ref: '#/components/schemas/MessageStatus'
        successCount:
          type: integer
          format: int32
        failureCount:
          type: integer
          format: int32
        totalCount:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        sentAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    MessageListItemDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/MessageListItemDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    MessageResultDto:
      type: object
      properties:
        channelId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        channelName:
          type: string
          nullable: true
          writeOnly: true
        status:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        sentAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    MessageSettingsDto:
      type: object
      properties:
        timeout:
          type: integer
          format: int32
        retryAttempts:
          type: integer
          format: int32
        retryDelay:
          type: integer
          format: int32
      additionalProperties: false
    MessageStatus:
      enum:
        - pending
        - sent
        - failed
        - partial
        - success
      type: string
    RecipientDto:
      required:
        - target
        - type
      type: object
      properties:
        name:
          type: string
          nullable: true
        target:
          minLength: 1
          type: string
        type:
          minLength: 1
          type: string
          description: 'Recipient type: to, cc, bcc'
      additionalProperties: false
    RuleEngineCreateWithoutDeviceIdRequest:
      required:
        - alertLevel
        - alertResetLevel
        - dataObjectName
        - notification
        - ruleName
      type: object
      properties:
        ruleName:
          minLength: 1
          pattern: ^(?!\s*$).+
          type: string
          description: 'Rule name. Ex: First rule'
        dataObjectName:
          minLength: 1
          type: string
          description: >-
            Target data object name. Represents the sensor name being
            surveilled. Ex: cpuUsage
        alertLevel:
          minLength: 1
          type: string
          description: 'Alert event threshold level. Ex: >=70'
        alertResetLevel:
          minLength: 1
          type: string
          description: 'Alert event reset threshold level. Ex: <70'
        delay:
          maximum: 9223372036854776000
          minimum: 0
          type: integer
          description: 'Seconds to delay publish event. Ex: 5'
          format: int64
        notification:
          $ref: '#/components/schemas/RuleEngineNotificationRequest'
      additionalProperties: false
      description: Create rule payload
    RuleEngineDto:
      required:
        - alertLevel
        - alertResetLevel
        - dataObjectName
        - ruleName
      type: object
      properties:
        alertRuleId:
          type: string
          description: Rule ID
          format: uuid
        ruleName:
          type: string
          description: Rule name
          nullable: true
        isEnabled:
          type: boolean
          description: Rule enabled/disabled status
        dataObjectName:
          type: string
          description: 'Target data object name. Ex: cpuUsage'
          nullable: true
        alertLevel:
          type: string
          description: 'Alert event threshold level. Ex: >=70'
          nullable: true
        alertResetLevel:
          type: string
          description: 'Alert event reset threshold level. Ex: <50'
          nullable: true
        delay:
          type: integer
          description: 'Seconds to delay publish event. Ex: 5'
          format: int64
        creationTime:
          type: string
          description: Creation time of the rule
          format: date-time
          nullable: true
        lastModificationTime:
          type: string
          description: Last modified time of the rule
          format: date-time
          nullable: true
        notification:
          $ref: '#/components/schemas/RuleEngineNotificationDto'
      additionalProperties: false
      description: Rule engine data transfer object
    RuleEngineDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RuleEngineDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    RuleEngineNotificationDto:
      required:
        - channelIds
        - recipients
      type: object
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: >-
            Channel ID for publish event. Ex:
            channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
          nullable: true
        templateId:
          type: string
          description: >-
            Template ID for publish event. Use together with variables. Do not
            use together with subject and content. Ex:
            tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/RecipientDto'
          description: Recipients for publish event.
          nullable: true
        variables:
          type: object
          additionalProperties:
            type: string
          description: >-
            Variables used in the template for publish event. Use together with
            templateId. Do not use together with subject and content. Ex:
            {"key1": "value1"}
          nullable: true
        subject:
          type: string
          description: >-
            Subject for publish event. Use together with content. Do not use
            together with templateId and variables.
          nullable: true
        content:
          type: string
          description: >-
            Content for publish event. Use together with subject. Do not use
            together with templateId and variables.
          nullable: true
      additionalProperties: false
      description: Notification configuration for the alert rule
    RuleEngineNotificationRequest:
      required:
        - channelIds
        - recipients
      type: object
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: >-
            Existed channel ID for publish event. Reference Get
            /notifications/channels. Ex:
            channel_3fa85f64-5717-4562-b3fc-2c963f66afa6
          nullable: true
        templateId:
          type: string
          description: >-
            Existed template ID for publish event. Use together with variables.
            Do not use together with subject and content. Reference Get
            /notifications/templates. Ex:
            tmpl_7fa85f64-5717-4562-b3fc-2c963f66afa6
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/RecipientDto'
          description: Recipients for publish event.
          nullable: true
        variables:
          type: object
          additionalProperties:
            type: string
          description: >-
            Variables used in the template for publish event. Use together with
            templateId. Do not use together with subject and content. Ex:
            {"key1": "value1", "key2": "value2"}
          nullable: true
        subject:
          type: string
          description: >-
            Subject for publish event. Use together with content. Do not use
            together with templateId and variables.
          nullable: true
        content:
          type: string
          description: >-
            Content for publish event. Use together with subject. Do not use
            together with templateId and variables.
          nullable: true
      additionalProperties: false
      description: >-
        Notification configuration. Use exactly one pair: templateId with
        variables, or subject with content.
    RuleEngineReplaceRequest:
      type: object
      properties:
        alertLevel:
          type: string
          description: 'Alert event threshold level. Ex: >=70'
          nullable: true
        alertResetLevel:
          type: string
          description: 'Alert event reset threshold level. Ex: <=50'
          nullable: true
        delay:
          type: integer
          description: 'Seconds to delay publish event. Ex: 5'
          format: int64
        notification:
          $ref: '#/components/schemas/RuleEngineNotificationRequest'
      additionalProperties: false
      description: Update rule engine payload
    RuleEngineReplaceStatusRequest:
      required:
        - isEnabled
      type: object
      properties:
        isEnabled:
          type: boolean
          description: Rule enabled/disabled
      additionalProperties: false
      description: Update rule engine status payload
    TelemetryResponseDtoDataObjects:
      type: object
      properties:
        deviceId:
          type: string
          description: Device ID
          nullable: true
        time:
          type: string
          description: DataObjects timestamp
          format: date-time
        dataObjects:
          type: object
          additionalProperties: {}
          description: DataObjects names and values
          nullable: true
        dataTypes:
          type: array
          items:
            type: string
          description: DataObjects data types
          nullable: true
      additionalProperties: false
      description: Telemetry data.
    TelemetryResponseDtoDataObjectsCursorBasedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TelemetryResponseDtoDataObjects'
          description: Array of data object values
          nullable: true
        nextCursor:
          type: integer
          description: Next cursor for pagination. Null if no more data.
          format: int64
          nullable: true
        hasMore:
          type: boolean
          description: Whether there are more results
      additionalProperties: false
      description: Cursor-based pagination result
    TemplateDetailDto:
      type: object
      properties:
        templateId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        templateName:
          type: string
          nullable: true
          writeOnly: true
        subject:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
        channelTypes:
          type: array
          items:
            type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    TemplateListItemDto:
      type: object
      properties:
        templateId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        templateName:
          type: string
          nullable: true
          writeOnly: true
        subject:
          type: string
          nullable: true
        channelTypes:
          type: array
          items:
            type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
      additionalProperties: false
    TemplateListItemDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TemplateListItemDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    TemplateResponseDto:
      type: object
      properties:
        templateId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        templateName:
          type: string
          nullable: true
          writeOnly: true
        subject:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
        channelTypes:
          type: array
          items:
            type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
      additionalProperties: false
    UpdateChannelDto:
      type: object
      properties:
        name:
          type: string
          nullable: true
        channelType:
          $ref: '#/components/schemas/ChannelType'
        description:
          type: string
          nullable: true
        isEnabled:
          type: boolean
          nullable: true
        commonSettings:
          $ref: '#/components/schemas/CommonSettingsDto'
        config:
          description: >-
            Channel-type-specific configuration object. Structure depends on
            channelType:


            **email**: `{ host* (string), port* (1-65535), username* (string),
            password* (string), senderEmail* (email), senderName (string),
            secure (bool) }`


            **teams**: `{ url* (URL) }`


            **linemessage**: `{ accessToken* (string), sendMode* ('push' |
            'multicast') }`


            **webhook**: `{ url* (URL), method*
            ('GET'|'POST'|'PUT'|'PATCH'|'DELETE'), contentType*
            ('applicationJson'|'applicationFormUrlEncoded'|'textPlain') }`


            Fields marked with * are required.
          nullable: true
        templateId:
          type: string
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/ChannelRecipientDto'
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    UpdateTemplateDto:
      type: object
      properties:
        name:
          maxLength: 200
          type: string
          nullable: true
        subject:
          maxLength: 500
          type: string
          nullable: true
        content:
          maxLength: 50000
          type: string
          nullable: true
        channelTypes:
          type: array
          items:
            $ref: '#/components/schemas/ChannelType'
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    CreateTunnelDto:
      required:
        - applicationHost
        - applicationPort
        - purpose
        - serviceType
        - tags
      type: object
      properties:
        serviceType:
          minLength: 1
          type: string
          description: >-
            **The type of service being tunneled**, e.g., "ssh", "http",
            "https", "vnc", "rdp", "mqtt".
          format: Enumeration
          default: ssh
        applicationHost:
          minLength: 1
          type: string
          description: |-
            **The target application host address**.
            Can be an IP address or a domain name.
        applicationPort:
          maximum: 65535
          minimum: 0
          type: integer
          description: >-
            **The target application port**.

            This is the port on the target host that the service is listening
            on.
          format: int32
        purpose:
          minLength: 1
          type: string
          description: |-
            **The purpose or justification for the tunnel**.
            A brief description of why this tunnel is being created.
        tags:
          type: array
          items:
            type: string
          description: |-
            **A list of tags for the tunnel**.
            Used for categorization or identification purposes.
      additionalProperties: false
      description: Data Transfer Object (DTO) required to create a new Tunnel.
    HealthStatus:
      enum:
        - HEALTHY
        - DEGRADED
        - UNHEALTHY
        - UNKNOWN
      type: string
    PagedResultDto of TunnelDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TunnelDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    ServiceType:
      enum:
        - ssh
        - http
        - https
        - vnc
        - rdp
        - mqtt
      type: string
    TerminateTunnelDto:
      type: object
      properties:
        reason:
          type: string
          description: |-
            The reason for terminating the tunnel.
            This should provide context for why the tunnel is being closed.
          nullable: true
        graceful:
          type: boolean
          description: >-
            Whether to perform a graceful shutdown.

            If true, the tunnel will attempt to close existing connections
            cleanly.

            If false, the tunnel will be terminated immediately.
        forceTimeout:
          type: integer
          description: >-
            Maximum time in seconds to wait for graceful termination before
            forcing closure.

            Only applies when graceful is true.
          format: int32
      additionalProperties: false
      description: Data Transfer Object for terminating a tunnel session.
    TunnelDetailDto:
      required:
        - applicationHost
        - purpose
        - tags
      type: object
      properties:
        tunnelSessionId:
          type: string
          description: Unique identifier for the tunnel session.
          format: uuid
        deviceId:
          type: string
          description: The device ID associated with this tunnel.
          nullable: true
        serviceType:
          $ref: '#/components/schemas/ServiceType'
        applicationPort:
          type: integer
          description: Target application port on the device.
          format: int32
        applicationHost:
          type: string
          description: Target application host address (IP or domain name).
          nullable: true
        creationTime:
          type: string
          description: The date and time when the tunnel was created.
          format: date-time
        purpose:
          type: string
          description: The purpose or justification for creating this tunnel.
          nullable: true
        tags:
          type: array
          items:
            type: string
          description: List of tags for categorization and identification.
          nullable: true
        sessionStatus:
          $ref: '#/components/schemas/TunnelSessionStatus'
        tunnelEndpoint:
          type: string
          description: Full tunnel endpoint URL for accessing the tunnel.
          nullable: true
        webSsh:
          type: string
          description: WebSsh access URL if available.
          nullable: true
        estimatedReadyTime:
          type: string
          description: Estimated time when the tunnel will be ready for use.
          format: date-time
          nullable: true
        lastHeartbeatTime:
          type: string
          description: Last time a heartbeat was received from the tunnel.
          format: date-time
          nullable: true
        terminatedTime:
          type: string
          description: The date and time when the tunnel was terminated.
          format: date-time
          nullable: true
        lastModificationTime:
          type: string
          description: The date and time when the tunnel was last modified.
          format: date-time
          nullable: true
        terminationSource:
          $ref: '#/components/schemas/TunnelTerminationSource'
        terminationReason:
          description: >-
            The reason for termination. For User-initiated terminations, this
            contains the parsed JSON payload.

            For TunnelServer or TunnelMgmt terminations, this contains a
            descriptive message.
          nullable: true
        links:
          description: >-
            HATEOAS links for related resources following HAL (Hypertext
            Application Language) format.

            Contains navigational links to related operations such as self,
            update, terminate, and list.
          nullable: true
        healthStatus:
          $ref: '#/components/schemas/HealthStatus'
      additionalProperties: false
      description: >-
        Detailed tunnel session information including health status and
        modification history.

        Extends EdgeSync.TunnelMgmt.Dtos.TunnelDto with additional detail
        fields.
    TunnelDto:
      required:
        - applicationHost
        - purpose
        - tags
      type: object
      properties:
        tunnelSessionId:
          type: string
          description: Unique identifier for the tunnel session.
          format: uuid
        deviceId:
          type: string
          description: The device ID associated with this tunnel.
          nullable: true
        serviceType:
          $ref: '#/components/schemas/ServiceType'
        applicationPort:
          type: integer
          description: Target application port on the device.
          format: int32
        applicationHost:
          type: string
          description: Target application host address (IP or domain name).
          nullable: true
        creationTime:
          type: string
          description: The date and time when the tunnel was created.
          format: date-time
        purpose:
          type: string
          description: The purpose or justification for creating this tunnel.
          nullable: true
        tags:
          type: array
          items:
            type: string
          description: List of tags for categorization and identification.
          nullable: true
        sessionStatus:
          $ref: '#/components/schemas/TunnelSessionStatus'
        tunnelEndpoint:
          type: string
          description: Full tunnel endpoint URL for accessing the tunnel.
          nullable: true
        webSsh:
          type: string
          description: WebSsh access URL if available.
          nullable: true
        estimatedReadyTime:
          type: string
          description: Estimated time when the tunnel will be ready for use.
          format: date-time
          nullable: true
        lastHeartbeatTime:
          type: string
          description: Last time a heartbeat was received from the tunnel.
          format: date-time
          nullable: true
        terminatedTime:
          type: string
          description: The date and time when the tunnel was terminated.
          format: date-time
          nullable: true
        lastModificationTime:
          type: string
          description: The date and time when the tunnel was last modified.
          format: date-time
          nullable: true
        terminationSource:
          $ref: '#/components/schemas/TunnelTerminationSource'
        terminationReason:
          description: >-
            The reason for termination. For User-initiated terminations, this
            contains the parsed JSON payload.

            For TunnelServer or TunnelMgmt terminations, this contains a
            descriptive message.
          nullable: true
        links:
          description: >-
            HATEOAS links for related resources following HAL (Hypertext
            Application Language) format.

            Contains navigational links to related operations such as self,
            update, terminate, and list.
          nullable: true
      additionalProperties: false
      description: Tunnel session data transfer object containing basic tunnel information.
    TunnelSessionStatus:
      enum:
        - REQUESTED
        - ESTABLISHING
        - ESTABLISHED
        - RECONNECTING
        - TERMINATING
        - TERMINATED
        - FAILED
      type: string
    TunnelTerminationSource:
      enum:
        - User
        - TunnelServer
        - TunnelMgmt
      type: string
    AuthType:
      enum:
        - None
      type: string
    CreateOrUpdateDataRangeDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DataRangeType'
        startAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
          nullable: true
        endAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
          nullable: true
      additionalProperties: false
    CreateOrUpdateDestinationDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DestinationType'
        method:
          $ref: '#/components/schemas/HttpMethod'
        endpoint:
          type: string
          nullable: true
        authType:
          $ref: '#/components/schemas/AuthType'
      additionalProperties: false
    CreateOrUpdateTriggerDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/TriggerType'
        oneTimeAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    CreateScheduleResultDto:
      type: object
      properties:
        usageJobId:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        repeatPeriod:
          $ref: '#/components/schemas/RepeatPeriod'
        endTime:
          type: string
          nullable: true
        timeZone:
          type: string
          nullable: true
        jobs:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    CreateScheduledJobRequestDto:
      required:
        - endTime
        - jobs
        - name
        - repeatPeriod
        - timeZone
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: active device count report
          default: active device count report
        repeatPeriod:
          $ref: '#/components/schemas/RepeatPeriod'
        endTime:
          minLength: 1
          type: string
          description: '2025-12-31'
          default: '2025-12-31'
        timeZone:
          minLength: 1
          type: string
          description: '+08:30'
          default: '+08:30'
        jobs:
          type: array
          items:
            type: string
          description: DataPointCount, ActiveDeviceCount
          default:
            - ActiveDeviceCount
            - DataPointCount
      additionalProperties: false
    CreateSubscriptionDto:
      required:
        - dataRange
        - destination
        - trigger
      type: object
      properties:
        trigger:
          $ref: '#/components/schemas/CreateOrUpdateTriggerDto'
        dataRange:
          $ref: '#/components/schemas/CreateOrUpdateDataRangeDto'
        destination:
          $ref: '#/components/schemas/CreateOrUpdateDestinationDto'
      additionalProperties: false
    DataRangeBaseDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DataRangeType'
      additionalProperties: false
    DataRangeType:
      enum:
        - Relative
        - Absolute
      type: string
    DeliveryRecordDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        subscriptionId:
          type: string
          format: uuid
        deliveredAt:
          type: string
          description: 'timestamp in ISO 8601 format. Example: 2025-09-01T00:00:00Z'
          format: date-time
        status:
          $ref: '#/components/schemas/DeliveryStatus'
        errorMessage:
          type: string
          nullable: true
      additionalProperties: false
    DeliveryStatus:
      enum:
        - Pending
        - Running
        - Success
        - Failed
      type: string
    DestinationBaseDto:
      required:
        - type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DestinationType'
      additionalProperties: false
    DestinationType:
      enum:
        - Webhook
      type: string
    GetScheduledJobResponseDto:
      type: object
      properties:
        usageJobId:
          type: string
          format: uuid
          nullable: true
        name:
          type: string
          nullable: true
        repeatPeriod:
          type: string
          nullable: true
        endTime:
          type: string
          nullable: true
        timeZone:
          type: string
          nullable: true
        jobs:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    HttpMethod:
      enum:
        - Post
        - Get
        - Put
      type: string
    RepeatPeriod:
      enum:
        - Daily
        - Weekly
        - Monthly
      type: string
    SubscriptionDto:
      required:
        - dataRange
        - destination
        - trigger
      type: object
      properties:
        id:
          type: string
          format: uuid
        isEnabled:
          type: boolean
        trigger:
          $ref: '#/components/schemas/TriggerBaseDto'
        dataRange:
          $ref: '#/components/schemas/DataRangeBaseDto'
        destination:
          $ref: '#/components/schemas/DestinationBaseDto'
        lastDeliveredStatus:
          $ref: '#/components/schemas/DeliveryStatus'
        lastDeliveredAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    SubscriptionDtoPagedResultDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionDto'
          nullable: true
        totalCount:
          type: integer
          format: int64
      additionalProperties: false
    TriggerBaseDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/TriggerType'
      additionalProperties: false
    TriggerType:
      enum:
        - Once
      type: string
    UpdatePutScheduledJobRequestDto:
      required:
        - endTime
        - jobs
        - name
        - timeZone
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: active device count report
          default: active device count report
        repeatPeriod:
          $ref: '#/components/schemas/RepeatPeriod'
        endTime:
          minLength: 1
          type: string
          description: '2026-12-31'
          default: '2026-12-31'
        timeZone:
          minLength: 1
          type: string
          description: Custom Time Zone
          default: '+08:30'
        jobs:
          type: array
          items:
            type: string
          description: DataPointCount, ActiveDeviceCount
          default:
            - ActiveDeviceCount
            - DataPointCount
      additionalProperties: false
    UpdateSubscriptionDto:
      type: object
      properties:
        isEnabled:
          type: boolean
        trigger:
          $ref: '#/components/schemas/CreateOrUpdateTriggerDto'
        dataRange:
          $ref: '#/components/schemas/CreateOrUpdateDataRangeDto'
        destination:
          $ref: '#/components/schemas/CreateOrUpdateDestinationDto'
      additionalProperties: false
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: http://localhost:44368/.well-known/openid-configuration
    Bearer:
      type: apiKey
      description: '手動輸入 JWT Token，格式: Bearer {your token}'
      name: Authorization
      in: header
x-tagGroups:
  - name: Public APIs
    tags:
      - ___swagger_1-iam_swagger_json_Auth
      - ___swagger_1-iam_swagger_json_Identity & Access
      - ___swagger_1-iam_swagger_json_Orgs
      - ___swagger_1-iam_swagger_json_OrgUsers
      - ___swagger_1-iam_swagger_json_Users
      - ___swagger_2-device-management_swagger_json_Batch Tasks
      - ___swagger_2-device-management_swagger_json_Devices
      - ___swagger_2-device-management_swagger_json_WEDA Node Credentials
      - ___swagger_3-custom-devices_swagger_json_Custom Device Components
      - ___swagger_3-custom-devices_swagger_json_Custom Devices
      - ___swagger_4-container-management_swagger_json_Container Commands
      - ___swagger_4-container-management_swagger_json_Container Deployments
      - ___swagger_4-container-management_swagger_json_Container Registries
      - ___swagger_4-container-management_swagger_json_Container Stacks
      - ___swagger_5-datapoints_swagger_json_Channel
      - ___swagger_5-datapoints_swagger_json_ChannelType
      - ___swagger_5-datapoints_swagger_json_FunctionTransfer
      - ___swagger_5-datapoints_swagger_json_Message
      - ___swagger_5-datapoints_swagger_json_RuleEngine
      - ___swagger_5-datapoints_swagger_json_Telemetry
      - ___swagger_5-datapoints_swagger_json_Template
      - ___swagger_5-datapoints_swagger_json_Notifications
      - ___swagger_5-datapoints_swagger_json_Data Objects
      - ___swagger_6-tunnel-management_swagger_json_Tunnels
      - ___swagger_7-reports_swagger_json_Reports
      - ___swagger_7-reports_swagger_json_UsageSummaryTask
