openapi: 3.0.3
info:
  version: 3.1.0-EarlyAccess
  x-visibility: external
  title: Remote Services API
  description: Early Access Notice - This API is in early access. All endpoints and functionalities are subject to change as development continues.
servers:
  - url: /api/connexus
tags:
  - name: Tenant Management
    description: Tenant management
  - name: Organization Management
    description: Organization Management
  - name: User Management
    description: User management
  - name: External User Management
    description: External User Management
  - name: User Group Management
    description: User group management
  - name: Product Management
    description: Product management
  - name: Node Management
    description: Node Management
  - name: Site Management
    description: Site Management
  - name: Gateway Management
    description: Gateway Management
  - name: Host Management
    description: Host Management
  - name: Target Management
    description: Target Management
  - name: Client Management
    description: Client Management
  - name: Tunnel Management
    description: Tunnel Management
  - name: Monitoring
    description: Monitoring
  - name: Connector Management
    description: Connector management
  - name: User Grant Management
    description: User grant management
  - name: User Group Grant Management
    description: User group grant management
  - name: Permission Request Management
    description: Permission Request management
  - name: Integration Management
    description: Integration management
  - name: Session Management
    description: Session management
paths:
  '/tenants/{id}':
    get:
      summary: Retrieve a tenant
      operationId: getTenant
      description: |
        Retrieve a tenant
      tags:
        - Tenant Management
      security:
        - tenant_management:
            - cnx.t.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceTenant'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /organizations:
    post:
      summary: Create a new organization
      operationId: createOrganization
      description: |
        Creates a new organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateOrganization'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all organizations
      operationId: listOrganizations
      description: |
        Lists all organizations
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.l
      parameters:
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceOrganizationListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}':
    get:
      summary: Retrieve an organization
      operationId: getOrganization
      description: |
        Retrieve an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete an organization
      operationId: deleteOrganization
      description: |
        Delete an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/owners':
    get:
      summary: List owners of an organization
      operationId: getOrganizationOwners
      description: |
        List owners of an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceOrganizationOwnerListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/ownership-history':
    get:
      summary: List an organization's ownership history
      operationId: getOrganizationOwnershipHistory
      description: |
        List an organization's ownership history 
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceOrganizationOwnershipHistoryRecordListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/appointed-owners-history':
    get:
      summary: List appointed owners for an organization
      operationId: getAppointedOwnersHistory
      description: |
        List appointed owners for an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.ho
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceAppointedOwnersHistoryRecordListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/add-owner':
    post:
      summary: Add a user as an owner to an organization
      operationId: addOrganizationOwner
      description: |
        Add a user as an owner to an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.ao
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToAddOrganizationOwner'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/remove-owner':
    post:
      summary: Remove a user's organization owner status from an organization
      operationId: removeOrganizationOwner
      description: |
        Remove a user's organization owner status from an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.ro
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRemoveOrganizationOwner'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/organizations/{id}/change-name':
    post:
      summary: Update an organization's name
      operationId: changeOrganizationName
      description: |
        Change name of an organization
      tags:
        - Organization Management
      security:
        - organization_management:
            - cnx.o.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeOrganizationName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /users:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new user
      operationId: createUser
      description: |
        Creates a new user
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateUser'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all users
      operationId: listUsers
      description: |
        Lists all users
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/email'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a user
      operationId: getUser
      description: |
        Retrieve a user
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceInternalUser'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a user
      operationId: deleteUser
      description: |
        Delete a user
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/organizations':
    get:
      summary: Get organizations a user has access to
      operationId: listUserOrganizations
      description: |
        Get organizations a user has access to
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserOrganizationListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/roles':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Get a user's roles in an organization
      operationId: getUserRoles
      description: |
        Get a user's roles in an organization
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUserRoleListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/grants':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Get a user's all grants in an organization
      operationId: listAllGrantsOfUser
      description: |
        Get a user's all grants in an organization
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceGrantListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/clients':
    get:
      summary: Get clients of a user
      operationId: listUserClients
      description: |
        Get clients of a user
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserClientListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/change-name':
    post:
      summary: Update a user's first and last name
      operationId: changeUserName
      description: |
        Change first and/or last name of a user
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestToChangeUserName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/activate':
    post:
      summary: Activate a user's account
      operationId: activateUserAccount
      description: |
        Activate a user's account
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestToActivateUser'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/users/{id}/suspend':
    post:
      summary: Suspend a user's account
      operationId: suspendUserAccount
      description: |
        Suspend a user's account
      tags:
        - User Management
      security:
        - user_management:
            - cnx.u.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /external-users:
    post:
      summary: Refer an external user to an organization
      operationId: addExternalUser
      description: |
        Refer an external user to an organization
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToAddExternalUser'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all external users
      operationId: listExternalUsers
      description: |
        List all external users
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/userId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceExternalUserListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/external-users/{id}':
    get:
      summary: Retrieve an external user referral
      operationId: getExternalUser
      description: |
        Retrieve an external user referral
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalUser'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Rescind the referral of an external user
      operationId: deleteExternalUser
      description: |
        Rescind the referral of an external user
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /external-users/audit-records:
    get:
      summary: List all external user referrals audit records
      operationId: listExternalUsersAuditRecords
      description: |
        List all external user referrals audit records
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/userId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceExternalUserAuditListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/external-users/{id}/admit':
    post:
      summary: Admit a pending external user
      operationId: adminExternalUser
      description: |
        Admit a pending external user
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.ad
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToAdmitExternalUser'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/external-users/{id}/revoke':
    post:
      summary: Revoke an admitted external user
      operationId: revokeExternalUser
      description: |
        Revoke an admitted external user
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.rv
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRevokeExternalUser'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/external-users/{id}/reject':
    post:
      summary: Reject a referred external user
      operationId: rejectExternalUser
      description: |
        Reject a referred external user
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.rj
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRejectExternalUser'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /external-users/revoke-all-admitted:
    post:
      summary: Revoke all admitted external users
      operationId: revokeAllAdmittedExternalUsers
      description: |
        Revoke all admitted external users
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.rv
      parameters:
        - $ref: '#/components/parameters/organizationId'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /external-users/reject-all-by-status:
    post:
      summary: Reject all external users by their status
      operationId: rejectAllExternalUsersByStatus
      description: |
        Reject all external users by their status
      tags:
        - External User Management
      security:
        - external_user_management:
            - cnx.eu.rj
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/externalUserStatus'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /user-groups:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new usergroup
      operationId: createUserGroup
      description: |
        Creates a new usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateUserGroup'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all usergroups
      operationId: listUserGroups
      description: |
        Lists all usergroups
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/userId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserGroupListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/user-groups/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a usergroup
      operationId: getUserGroup
      description: |
        Retrieve a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUserGroup'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a usergroup
      operationId: deleteUserGroup
      description: |
        Delete a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/user-groups/{id}/users':
    get:
      summary: List all users in a usergroup
      operationId: listUsersOfUserGroup
      description: |
        List all users in a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserInUserGroupListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/user-groups/{id}/change-name':
    post:
      summary: Update a usergroup's name
      operationId: changeUserGroupName
      description: |
        Change name of a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestToChangeUserGroupName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/user-groups/{id}/add-user':
    post:
      summary: Add a user to a usergroup
      operationId: addUserToUserGroup
      description: |
        Add a user to a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.au
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestToAddUserToUserGroup'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/user-groups/{id}/remove-user':
    post:
      summary: Remove a user from a usergroup
      operationId: removeUserFromUserGroup
      description: |
        Remove a user from a usergroup
      tags:
        - User Group Management
      security:
        - user_group_management:
            - cnx.ug.ru
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestToRemoveUserFromUserGroup'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /products:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new product node
      operationId: createProduct
      description: |
        Creates a new product node
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateProduct'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all product nodes
      operationId: listProducts
      description: |
        Lists all product nodes
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.l
      parameters:
        - $ref: '#/components/parameters/parentId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceProductListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/products/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a product node
      operationId: getProduct
      description: |
        Retrieve a product node
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductNode'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a product node
      operationId: deleteProduct
      description: |
        Delete a product node
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/products/{id}/change-name':
    post:
      summary: Update a product's name
      operationId: changeProductName
      description: |
        Change name of a product
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeProductName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/products/{id}/move':
    post:
      summary: Move product from a parent to another
      operationId: moveProduct
      description: |
        Move product from a parent to another
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToMoveProduct'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/products/{id}/copy':
    post:
      summary: Copy product from a parent to another
      operationId: copyProduct
      description: |
        Copy product from a parent to another
      tags:
        - Product Management
      security:
        - product_management:
            - cnx.p.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCopyProduct'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /nodes:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new node
      operationId: createNode
      description: |
        Creates a new node
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateNode'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all nodes
      operationId: listNodes
      description: |
        Lists all nodes
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.l
      parameters:
        - $ref: '#/components/parameters/parentId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceNodeListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/nodes/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a node
      operationId: getNode
      description: |
        Retrieve a node
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a node
      operationId: deleteNode
      description: |
        Delete a node
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/nodes/{id}/change-name':
    post:
      summary: Update a node's name
      operationId: changeNodeName
      description: |
        Change name of a node
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeNodeName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/nodes/{id}/move':
    post:
      summary: Move a node to another parent
      operationId: moveNode
      description: |
        Move a node to another parent
      tags:
        - Node Management
      security:
        - node_management:
            - cnx.n.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToMoveNode'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /sites:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new site
      operationId: createSite
      description: |
        Creates a new site
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateSite'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all sites
      operationId: listSites
      description: |
        Lists all sites
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.l
      parameters:
        - $ref: '#/components/parameters/nodeId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceSiteListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/sites/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a site
      operationId: getSite
      description: |
        Retrieve a site
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a site
      operationId: deleteSite
      description: |
        Delete a site
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/sites/{id}/change-name':
    post:
      summary: Update a site's name
      operationId: changeSiteName
      description: |
        Change name of a site
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeSiteName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/sites/{id}/lock-connectivity':
    post:
      summary: Lock site connectivity.
      operationId: lockSiteConnectivity
      description: |
        Lock site connectivity.
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.lk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/sites/{id}/unlock-connectivity':
    post:
      summary: Unlock site connectivity.
      operationId: unlockSiteConnectivity
      description: |
        Unlock site connectivity.
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.ulk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/sites/{id}/move':
    post:
      summary: Move a site to another parent
      operationId: moveSite
      description: |
        Move a site to another parent
      tags:
        - Site Management
      security:
        - site_management:
            - cnx.s.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToMoveSite'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /gateways:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new gateway
      operationId: createGateway
      description: |
        Creates a new gateway
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateGateway'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all gateways
      operationId: listGateways
      description: |
        Lists all gateways
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.l
      parameters:
        - $ref: '#/components/parameters/siteIdRequired'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceGatewayListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/gateways/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a gateway
      operationId: getGateway
      description: |
        Retrieve a gateway
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a gateway
      operationId: deleteGateway
      description: |
        Delete a gateway
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/gateways/{id}/change-name':
    post:
      summary: Update a gateway's name
      operationId: changeGatewayName
      description: |
        Change name of a gateway
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeGatewayName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/gateways/{id}/lock-connectivity':
    post:
      summary: Lock gateway connectivity.
      operationId: lockGatewayConnectivity
      description: |
        Lock gateway connectivity.
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.lk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/gateways/{id}/unlock-connectivity':
    post:
      summary: Unlock gateway connectivity.
      operationId: unlockGatewayConnectivity
      description: |
        Unlock gateway connectivity.
      tags:
        - Gateway Management
      security:
        - gateway_management:
            - cnx.gw.ulk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /hosts:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new host
      operationId: createHost
      description: |
        Creates a new host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateHost'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all hosts
      operationId: listHosts
      description: |
        Lists all hosts
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.l
      parameters:
        - $ref: '#/components/parameters/siteIdRequired'
        - $ref: '#/components/parameters/gatewayId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceHostListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a host
      operationId: getHost
      description: |
        Retrieve a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Host'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a host
      operationId: deleteHost
      description: |
        Delete a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/clients':
    get:
      summary: Get clients of a host
      operationId: listHostClients
      description: |
        Get clients of a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceHostClientListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/change-name':
    post:
      summary: Update a host's name
      operationId: changeHostName
      description: |
        Change name of a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeHostName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/change-address':
    post:
      summary: Update a host's address
      operationId: changeHostAddress
      description: |
        Change address of a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeHostAddress'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/change-product':
    post:
      summary: Change product of a host
      operationId: changeHostProduct
      description: |
        Change product of a host
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeProduct'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/lock-connectivity':
    post:
      summary: Lock host connectivity.
      operationId: lockHostConnectivity
      description: |
        Lock host connectivity.
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.lk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/hosts/{id}/unlock-connectivity':
    post:
      summary: Unlock host connectivity.
      operationId: unlockHostConnectivity
      description: |
        Unlock host connectivity.
      tags:
        - Host Management
      security:
        - host_management:
            - cnx.h.ulk
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /targets:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new target
      operationId: createTarget
      description: |
        Creates a new target
      tags:
        - Target Management
      security:
        - target_management:
            - cnx.tg.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateTarget'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all targets
      operationId: listTargets
      description: |
        Lists all targets
      tags:
        - Target Management
      security:
        - target_management:
            - cnx.tg.l
      parameters:
        - $ref: '#/components/parameters/hostId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceTargetListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/targets/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a target
      operationId: getTarget
      description: |
        Retrieve a target
      tags:
        - Target Management
      security:
        - target_management:
            - cnx.tg.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Target'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a target
      operationId: deleteTarget
      description: |
        Delete a target
      tags:
        - Target Management
      security:
        - target_management:
            - cnx.tg.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /clients/accessible-by-user:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: List clients a user has access to
      operationId: listAccessibleClientsForUser
      description: |
        List clients a user has access to
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.l
      parameters:
        - $ref: '#/components/parameters/userIdrequired'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceClientListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/clients/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a client
      operationId: getClient
      description: |
        Retrieve a client
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/clients/{id}/package':
    post:
      summary: Prepare a client package
      operationId: packageClient
      description: |
        Prepare a client package consisting of client binary and client configuration files and 
        retrieve pre-signed URL to download it.

        The response contains a 1-hour pre-signed URL to download the package once it is ready.

        Since the version number 1.1.7 the package will have the name in this pattern:

          - "rs-{client type}_endpoint-package-{package type}-v{version}-{clientId}.tar.gz"

          - i.e. rs-device_endpoint-package-x64_windows10-v1.1.7-2728345572233708693.tar.gz
          - i.e. rs-service_endpoint-package-x64_windows10-v1.1.7-1500.tar.gz

        The package prior to version 1.1.7 will have the name in this pattern:

          - "rs-{clientType}-endpoint-{clientId}-v{version}-{legacy package type}.tar.gz"

          - i.e. rs-device-endpoint-2461017992494843023-v1.1.6-x64-windows10-bin.tar.gz
          - i.e. rs-service-endpoint-1500-v1.1.6-x64-windows10-bin.tar.gz
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.pkg
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateClientPackage'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/clients/{id}/configuration':
    post:
      summary: Prepare a client configuration
      operationId: retrieveClientConfiguration
      description: |
        Prepare a client configuration file and retrieve pre-signed URL to download it.

        The response contains a 1-hour pre-signed URL to download the configuration file once it is ready.

        Since the version number 1.1.7 the configuration file package will have the name in this pattern:

          - "rs-{client type}_endpoint-configuration-{package type}-v{version}-{clientId}.tar.gz"

          - i.e. rs-device_endpoint-configuration-x64_windows10-v1.1.7-2728345572233708693.tar.gz
          - i.e. rs-service_endpoint-configuration-x64_windows10-v1.1.7-1500.tar.gz

        The configuration file package prior to version 1.1.7 will have the name in this pattern:

          - "rs-{client type}-config-{clientId}-{legacy package type}.tar.gz"

          - i.e. rs-device-config-2461017992494843023-x64-docker-img.tar.gz
          - i.e. rs-service-config-2461017992494843023-x64-docker-img.tar.gz
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.cfg
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateClientConfiguration'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/clients/{id}/configuration-content':
    post:
      summary: Get client configuration with specified encoding
      operationId: getClientConfiguration
      description: |
        Get client configuration file with specified encoding and retrieve the content of configuration file directly in response.
        Currently, the only supported encoding type is base64.
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.cfg
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
        - name: encoding
          in: query
          description: 'The encoding type for the configuration file. Currently, only ''base64'' is supported.'
          required: true
          schema:
            type: string
            enum:
              - base64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateClientConfiguration'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    type: string
                    description: The configuration content
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /clients/binary:
    post:
      summary: Prepare a client binary
      operationId: retrieveClientBinary
      description: |
        Prepare a client binary and retrieve pre-signed URL to download it

        Prepare a client binary package consisting of client binary only and 
        retrieve pre-signed URL to download it.

        The response contains a 1-hour pre-signed URL to download the package once it is ready.

        Since the version number 1.1.7 the binary package will have the name in this pattern:

          - "rs-endpoint-binary-{package type}-v{version}.tar.gz"

          - i.e. rs-endpoint-binary-x64_windows10-v1.1.7.tar.gz

        The binary package prior to version 1.1.7 will have the name in this pattern:

          - "rs-endpoint-{legacy package type}-{version}.tar.gz"

          - i.e. rs-endpoint-x64-windows10-bin-1.1.6.tar.gz
      tags:
        - Client Management
      security:
        - client_management:
            - cnx.cl.pkg
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateClientBinary'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /tunnels:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new tunnel
      operationId: createTunnel
      description: |
        Creates a new tunnel
      tags:
        - Tunnel Management
      security:
        - tunnel_management:
            - cnx.tn.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateTunnel'
      responses:
        '201':
          description: Resource is created
          headers:
            Location:
              description: URI to the resource.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all tunnels
      operationId: listTunnels
      description: |
        Lists all tunnels
      tags:
        - Tunnel Management
      security:
        - tunnel_management:
            - cnx.tn.l
      parameters:
        - $ref: '#/components/parameters/organizationIdoptional'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceTunnelListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/tunnels/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a tunnel
      operationId: getTunnel
      description: |
        Retrieve a tunnel
      tags:
        - Tunnel Management
      security:
        - tunnel_management:
            - cnx.tn.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tunnel'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/tunnels/{id}/request-termination':
    post:
      summary: Request termination of a tunnel.
      operationId: requestTunnelTermination
      description: |
        Request termination of a tunnel.
      tags:
        - Tunnel Management
      security:
        - tunnel_management:
            - cnx.tn.rt
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /tunnels/network-interfaces:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: List network interfaces of a client.
      operationId: listNetworkInterfaces
      description: |
        List network interfaces of a client to establish proxy unaware tunnel.
      tags:
        - Tunnel Management
      security:
        - tunnel_management:
            - cnx.tn.r
      parameters:
        - $ref: '#/components/parameters/clientIdRequired'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  networkInterfaces:
                    type: array
                    items:
                      $ref: '#/components/schemas/Address'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /monitoring/health/gateways:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a gateway health
      operationId: getGatewayHealth
      description: |
        Retrieve a gateway health
        **Long Polling Request:**
         - `await` parameter must be true.
         - `gatewayId` must be included.

         **Regular Request:**
         - `await` parameter must be false.
         - Must include at least one of the parameters: `gatewayId` or `siteId`.
      tags:
        - Monitoring
      security:
        - host_management:
            - cnx.mon.r
      parameters:
        - $ref: '#/components/parameters/gatewayId'
        - $ref: '#/components/parameters/siteId'
        - $ref: '#/components/parameters/await'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceGatewayHealthListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /monitoring/health/hosts:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a host health
      operationId: getHostHealth
      description: |
        Retrieve a host health
        **Long Polling Request:**
        - `await` parameter must be true.
        - `hostId` must be included.

        **Regular Request:**
        - `await` parameter must be false.
        - Must include at least one of the parameters: `gatewayId` or `hostId`.
      tags:
        - Monitoring
      security:
        - host_management:
            - cnx.mon.r
      parameters:
        - $ref: '#/components/parameters/hostId'
        - $ref: '#/components/parameters/gatewayId'
        - $ref: '#/components/parameters/await'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceHostHealthListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /monitoring/health/clients:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a client health
      operationId: getClientHealth
      description: |
        Retrieve a client health
        **Long Polling Request:**
        - `await` parameter must be true.
        - `clientId` must be included.

        **Regular Request:**
        - `await` parameter must be false.
        - Must include at least one of the following parameters: `clientId`, or `ownerId` and `ownerType`.

        **Owner Type Rules:**
        - `ownerType` can be `USER`, `HOST`, `TECHNICAL_USER`, or `GLOBAL_TECHNICAL_USER`.
        - Only `USER` and `HOST` are supported in the current release.
        - Sending `TECHNICAL_USER` or `GLOBAL_TECHNICAL_USER` will result in an `UnsupportedFeatureException`.

        **ID Rules:**
        - If `ownerType` is `HOST`, `ownerId` must be HOST id.
        - If `ownerType` is `USER`, `ownerId` must be USER id.
        - If `ownerType` is provided, `ownerId` must be included.
      tags:
        - Monitoring
      security:
        - host_management:
            - cnx.mon.r
      parameters:
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/ownerType'
        - $ref: '#/components/parameters/ownerId'
        - $ref: '#/components/parameters/await'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceClientHealthListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /monitoring/tunnel-status:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve tunnel status
      operationId: getTunnelStatus
      description: |
        Retrieve active tunnel status

        **Long Polling Request:**
        - `await` parameter must be true.
        - Either `hostId` or `clientId` must be included.

        **Regular Request:**
        - `await` parameter must be false.
        - Must include at least one of the parameters: `organizationId`, `clientId`, `tunnelId`, or `hostId`.
      tags:
        - Monitoring
      security:
        - host_management:
            - cnx.mon.r
      parameters:
        - $ref: '#/components/parameters/tunnelId'
        - $ref: '#/components/parameters/hostId'
        - $ref: '#/components/parameters/organizationIdoptional'
        - $ref: '#/components/parameters/clientId'
        - $ref: '#/components/parameters/await'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  clients:
                    type: array
                    items:
                      description: A JSON document specifying a tunnel status information
                      type: object
                      properties:
                        tunnelId:
                          $ref: '#/components/schemas/Tunnel/properties/id'
                        reportedAt:
                          $ref: '#/components/schemas/Timestamp'
                        status:
                          $ref: '#/components/schemas/TunnelStatus'
                        targetId:
                          $ref: '#/components/schemas/TargetId'
                      required:
                        - tunnelId
                        - status
                  meta:
                    type: object
                    properties:
                      page:
                        $ref: '#/components/schemas/Page'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  /connectors:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new connector
      operationId: createConnector
      description: |
        Creates a new connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceConnector'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all connectors
      operationId: listConnectors
      description: |
        Lists all connectors
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceConnectorListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a connector
      operationId: getConnector
      description: |
        Retrieve a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceConnector'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a connector
      operationId: deleteConnector
      description: |
        Delete a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.d
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '204':
          description: No content
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/change-name':
    post:
      summary: Update connector's name
      operationId: changeConnectorName
      description: |
        Change name of a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeConnectorName'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/change-description':
    post:
      summary: Update connector's description
      operationId: changeConnectorDescription
      description: |
        Change description of a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeConnectorDescription'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/require-permission':
    post:
      summary: Enforce permission for connector
      operationId: requirePermissionForConnector
      description: |
        Enforce permission for connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/require-no-permission':
    post:
      summary: Do not require a permission for connector
      operationId: doNotRequirePermissionForConnector
      description: |
        Do not require a permission for connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/never-times-out':
    post:
      summary: Set idle timeout configuration to be infinite
      operationId: markConnectorNeverTimesOut
      description: |
        Set idle timeout configuration to be infinite
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/change-idle-timeout':
    post:
      summary: Update connector's idle timeout configuration
      operationId: changeConnectorIdleTimeout
      description: |
        Change idle timeout configuration of a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeConnectorIdleTimeout'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/connectors/{id}/change-parameters':
    post:
      summary: Update connector's parameters
      operationId: changeConnectorPArameters
      description: |
        Change parameters of a connector
      tags:
        - Connector Management
      security:
        - connector_management:
            - cnx.a.u
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
        - $ref: '#/components/parameters/x-user-role'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToChangeConnectorParameters'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /user-grants:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new user grant
      operationId: createUserGrant
      description: |
        Creates a new user grant
      tags:
        - User Grant Management
      security:
        - user_grant_management:
            - cnx.gu.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateUserGrant'
      responses:
        '201':
          description: Resource is created
          headers:
            Location:
              description: URI to the resource.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all user grants
      operationId: listUserGrants
      description: |
        Lists all user grants
      tags:
        - User Grant Management
      security:
        - user_grant_management:
            - cnx.gu.l
      parameters:
        - $ref: '#/components/parameters/userId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserGrantListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/user-grants/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a user grant
      operationId: getUserGrant
      description: |
        Retrieve a user grant
      tags:
        - User Grant Management
      security:
        - user_grant_management:
            - cnx.gu.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUserGrant'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a user grant
      operationId: deleteUserGrant
      description: |
        Delete a user grant
      tags:
        - User Grant Management
      security:
        - user_grant_management:
            - cnx.gu.d
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/Default'
  /user-group-grants:
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    post:
      summary: Create a new usergroup grant
      operationId: createUserGroupGrant
      description: |
        Creates a new usergroup grant
      tags:
        - User Group Grant Management
      security:
        - user_group_grant_management:
            - cnx.gug.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreateUserGroupGrant'
      responses:
        '201':
          description: Resource is created
          headers:
            Location:
              description: URI to the resource.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all usergroup grants
      operationId: listUserGroupGrants
      description: |
        Lists all usergroup grants
      tags:
        - User Group Grant Management
      security:
        - user_group_grant_management:
            - cnx.gug.l
      parameters:
        - $ref: '#/components/parameters/userGroupId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceUserGroupGrantListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/user-group-grants/{id}':
    parameters:
      - $ref: '#/components/parameters/x-user-role'
    get:
      summary: Retrieve a usergroup grant
      operationId: getUserGroupGrant
      description: |
        Retrieve a usergroup grant
      tags:
        - User Group Grant Management
      security:
        - user_group_grant_management:
            - cnx.gug.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUserGroupGrant'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
    delete:
      summary: Delete a usergroup grant
      operationId: deleteUserGroupGrant
      description: |
        Delete a usergroup grant
      tags:
        - User Group Grant Management
      security:
        - user_group_grant_management:
            - cnx.gug.d
      parameters:
        - $ref: '#/components/parameters/ID'
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/Default'
  /permission-requests:
    post:
      summary: Create a new permission request
      operationId: createPermissionRequest
      description: |
        Create a new permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToCreatePermissionRequest'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
    get:
      summary: List all permission requests
      operationId: listPermissionRequests
      description: |
        List all permission requests
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/enriched'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourcePermissionRequestListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}':
    get:
      summary: Retrieve a permission request
      operationId: getPermissionRequest
      description: |
        Retrieve a permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/enriched'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionRequest'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/set-requester-comment':
    post:
      summary: Set requester comment for permission request
      operationId: setRequesterComment
      description: |
        Set requester comment for permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.rqc
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToSetRequesterComment'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/withdraw':
    post:
      summary: Withdraw a pending permission request
      operationId: withdrawPermissionRequest
      description: |
        Withdraw a pending permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.w
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/return':
    post:
      summary: Return an approved permission request
      operationId: returnPermissionRequest
      description: |
        Return an approved permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.ret
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/set-reviewer-comment':
    post:
      summary: Set reviewer comment for permission request
      operationId: setReviewerComment
      description: |
        Set reviewer comment for permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.rwc
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToSetReviewerComment'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/approve':
    post:
      summary: Approve a pending permission request
      operationId: approvePermissionRequest
      description: |
        Approve a pending permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.a
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToApprovePermissionRequest'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/reject':
    post:
      summary: Reject a pending permission request
      operationId: rejectPermissionRequest
      description: |
        Reject a pending permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.rj
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRejectPermissionRequest'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/permission-requests/{id}/revoke':
    post:
      summary: Revoke an approved permission request
      operationId: revokePermissionRequest
      description: |
        Revoke an approved permission request
      tags:
        - Permission Request Management
      security:
        - permission_request_management:
            - cnx.pr.rv
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRevokePermissionRequest'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /integrations:
    get:
      summary: List all integrations
      operationId: listIntegrations
      description: |
        Lists all integrations
      tags:
        - Integration Management
      security:
        - integration_management:
            - cnx.int.l
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceIntegrationListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  '/integrations/{id}/mappings':
    get:
      summary: List mappings of an integration
      operationId: getIntegrationMappings
      description: |
        List mappings of an integration
      tags:
        - Integration Management
      security:
        - integration_management:
            - cnx.int.r
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceIntegrationMappingListResponse'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
  '/integrations/{id}/add-mapping':
    post:
      summary: Add a mapping to an integration
      operationId: addIntegrationMapping
      description: |
        Add a mapping to an integration
      tags:
        - Integration Management
      security:
        - integration_management:
            - cnx.int.am
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToAddIntegrationMapping'
      responses:
        '201':
          description: Resource is created
          headers:
            Location:
              description: URI to the resource.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  '/integrations/{id}/remove-mapping':
    post:
      summary: Remove a mapping from an integration
      operationId: removeIntegrationMapping
      description: |
        Remove a mapping from an integration
      tags:
        - Integration Management
      security:
        - integration_management:
            - cnx.int.rm
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/x-version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyToRemoveIntegrationMapping'
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        default:
          $ref: '#/components/responses/Default'
  /integrations/mappings:
    get:
      summary: List all mappings
      operationId: listMappings
      description: |
        List all mappings
      tags:
        - Integration Management
      security:
        - integration_management:
            - cnx.int.l
      parameters:
        - $ref: '#/components/parameters/organizationIdoptional'
        - $ref: '#/components/parameters/externalSystem'
        - $ref: '#/components/parameters/externalResourceId'
        - $ref: '#/components/parameters/externalResourceType'
        - $ref: '#/components/parameters/number'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceMappingQueryItemListResponse'
        '304':
          description: Not modified
        default:
          $ref: '#/components/responses/Default'
  /session/user-info:
    get:
      summary: Retrieve a user session info
      operationId: getUserSessionInfo
      description: |
        Retrieve a user session info
      tags:
        - Session Management
      security:
        - session_management:
            - cnx.sm.r
      parameters:
        - $ref: '#/components/parameters/IfNoneMatch'
      responses:
        '200':
          description: Successful operation
          headers:
            ETag:
              schema:
                type: string
              description: ETag hash of the returned resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUserSession'
        '304':
          description: Not modified
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        default:
          $ref: '#/components/responses/Default'
components:
  parameters:
    ID:
      name: id
      in: path
      description: Specifies the ID for the resource
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    tenantIdOpt:
      name: tenantId
      in: query
      description: Specifies the ID of the tenant
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    tenantId:
      name: tenantId
      in: query
      description: Specifies the ID of the tenant
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    organizationId:
      name: organizationId
      in: query
      description: Specifies the ID of the organization
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    organizationIdoptional:
      name: organizationId
      in: query
      description: Specifies the ID of the organization
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    email:
      name: email
      in: query
      description: Specifies the email of the relevant user
      required: false
      schema:
        type: string
        pattern: '^[a-zA-Z0-9._%+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$'
        example: john_doe@server.org
        minLength: 1
        maxLength: 255
    userId:
      name: userId
      in: query
      description: Specifies the ID of the relevant user
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    userIdrequired:
      name: userId
      in: query
      description: Specifies the ID of the relevant user
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    externalUserStatus:
      name: status
      in: query
      description: Specifies the status of the external user
      required: true
      schema:
        $ref: '#/components/schemas/ExternalUserStatus'
    userGroupId:
      name: userGroupId
      in: query
      description: Specifies the ID of the relevant usergroup
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    nodeId:
      name: nodeId
      in: query
      description: Specifies the ID of the relevant tree node
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    nodeIdrequired:
      name: nodeId
      in: query
      description: Specifies the ID of the relevant tree node
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    grantRole:
      name: user-role
      in: query
      description: Specifies a user role
      required: false
      schema:
        $ref: '#/components/schemas/UserGrantRole'
    siteId:
      name: siteId
      in: query
      description: Specifies the ID of the relevant site
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    siteIdRequired:
      name: siteId
      in: query
      description: Specifies the ID of the relevant site
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    gatewayId:
      name: gatewayId
      in: query
      description: Specifies the ID of the relevant gateway
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    hostId:
      name: hostId
      in: query
      description: Specifies the ID of the relevant host
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    connectorId:
      name: connectorId
      in: query
      description: Specifies the ID of the relevant connector
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    filePath:
      name: path
      in: query
      description: Path to a file
      required: true
      schema:
        type: string
        minLength: 0
        maxLength: 2048
    parentId:
      name: parentId
      in: query
      description: Specifies the parentId of a tree node
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    tunnelId:
      name: tunnelId
      in: query
      description: Specifies the tunnelId of a tunnel
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    clientId:
      name: clientId
      in: query
      description: Specifies the clientId of a client
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    clientIdRequired:
      name: clientId
      in: query
      description: Specifies the clientId of a client
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    ownerId:
      name: ownerId
      in: query
      description: Specifies the ownerId of a client
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
    ownerType:
      name: ownerType
      in: query
      description: Specifies the ownerType of a client
      required: false
      schema:
        $ref: '#/components/schemas/ClientOwnerType'
    await:
      name: await
      in: query
      required: false
      description: Flag to instruct the endpoint to wait before responding untile it detects a change. (Long polling)
      schema:
        type: boolean
        default: false
    externalSystem:
      name: externalSystem
      in: query
      description: Specifies the externalSystem
      required: false
      schema:
        $ref: '#/components/schemas/ExternalSystemType'
    externalResourceId:
      name: externalResourceId
      in: query
      description: Specifies the external resource id
      required: false
      schema:
        $ref: '#/components/schemas/ResourceId'
    externalResourceType:
      name: externalResourceType
      in: query
      description: Specifies the external resource type
      required: false
      schema:
        $ref: '#/components/schemas/ResourceType'
    featureName:
      name: featureName
      in: query
      description: Specifies the name of a feature
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 64
    x-user-role:
      name: x-user-role
      in: header
      description: Specifies the user role with which the user intends to perform the operation
      required: true
      schema:
        $ref: '#/components/schemas/UserGrantRole'
    x-version:
      name: x-version
      in: header
      description: Specifies the version of the resource
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
    number:
      name: number
      in: query
      description: Index of page to be returned. Number of available pages is returned in response body property page.totalPages.
      schema:
        type: integer
        default: 0
        minimum: 0
    size:
      name: size
      in: query
      description: Specifies the number of elements in a page. Maximum number of resources to be returned per page. The service might return less resources.
      schema:
        type: integer
        default: 10
        maximum: 100
    sort:
      name: sort
      in: query
      description: |
        Specifies the fields to sort the results by.

        Ex: GET /resources?sort=-color,+name : Sorts the results based on descending color order and ascending name order.
      schema:
        type: string
    filter:
      name: filter
      in: query
      required: false
      description: |
        JSON string allowing to filter for the following optional fields and operations.

          JSON string can contain following fields:
        * id
        E.g.: {"id":275}
        * name
        E.g.: {"name":"CISCO"}            
        * parentId
        E.g.: {"parentId":263}            

        In the following, an unencoded example filter value is shown, to return the connector instances for given asset and parameters. 

            { 
              "name":"CISCO"
            }
      schema:
        type: string
    enriched:
      name: enriched
      in: query
      required: false
      description: Flag to instruct the endpoint to return the human readable information.
      schema:
        type: boolean
        default: false
    IfNoneMatch:
      name: If-None-Match
      in: header
      description: Specifies the ETag of the resource
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 255
  responses:
    Created:
      description: Resource is created
      headers:
        Location:
          schema:
            type: string
          description: URI to the resource.
        x-version:
          schema:
            type: integer
          description: Resource version used for concurrency control.
    Accepted:
      description: Request is accepted
      headers:
        x-version:
          schema:
            type: integer
          description: Resource version used for concurrency control.
    BadRequest:
      description: |
        The status code implies that some parts of the provided information in the request are not valid. Possible errors:
        <br>
        <table>
          <colgroup>
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 70%;">
          </colgroup>
          <tr>
            <th align="left">Code Suffix</th>
            <th align="left">Message (parametrized)</th>
          </tr>
          <tr>
            <td>invalidParameter</td>
            <td>Parameter is invalid.</td>
          </tr>
        </table>
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    ResourceNotFound:
      description: |
        The status code implies that requested resource does not exist or unreachable for the requester. Possible errors:
        <br>
        <table>
          <colgroup>
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 70%;">
          </colgroup>
          <tr>
            <th align="left">Code Suffix</th>
            <th align="left">Message (parametrized)</th>
          </tr>
          <tr>
            <td>notFound</td>
            <td>Requested resource is not found.</td>
          </tr>
        </table>
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    ResourceConflict:
      description: |
        The status code implies that requested resource is updated by a third party. Possible errors:
        <br>
        <table>
          <colgroup>
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 70%;">
          </colgroup>
          <tr>
            <th align="left">Code Suffix</th>
            <th align="left">Message (parametrized)</th>
          </tr>
          <tr>
            <td>conflict</td>
            <td>Resource is updated.</td>
          </tr>
        </table>
      headers:
        x-version:
          schema:
            type: integer
          description: Resource version used for concurrency control.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    Default:
      description: Other error with any status code and response body format.
  schemas:
    TenantId:
      description: The ID of a tenant.
      type: string
      pattern: '[a-zA-Z0-9-_.]+'
      example: myTenant
      minLength: 1
      maxLength: 255
    ResourceTenant:
      description: A JSON document specifying a tenant
      type: object
      properties:
        id:
          $ref: '#/components/schemas/TenantId'
        name:
          $ref: '#/components/schemas/TenantName'
        serviceProvider:
          type: object
          properties:
            organizationId:
              $ref: '#/components/schemas/OrganizationId'
          required:
            - organizationId
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - serviceProvider
    TenantName:
      description: Name of the tenant.
      type: string
      example: company
      minLength: 1
      maxLength: 255
    OrganizationId:
      description: The ID of an organization.
      type: string
      example: a1b2c3d4
      maxLength: 255
    OrganizationName:
      description: Name of the organization.
      type: string
      example: Carrots Inc
      minLength: 1
      maxLength: 255
    RequestBodyToCreateOrganization:
      description: A JSON document specifying an organization
      type: object
      properties:
        name:
          $ref: '#/components/schemas/OrganizationName'
        orgOwnerUserId:
          $ref: '#/components/schemas/UserId'
      required:
        - name
        - orgOwnerUserId
    PagedResourceOrganizationListResponse:
      type: object
      properties:
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Organization:
      description: A JSON document specifying an organization
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/OrganizationName'
        rootNodeId:
          $ref: '#/components/schemas/NodeId'
        rootProductId:
          $ref: '#/components/schemas/ProductId'
        ownershipStatus:
          $ref: '#/components/schemas/OrganizationOwnershipStatus'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - rootNodeId
        - rootProductId
        - ownershipStatus
    PagedResourceOrganizationOwnerListResponse:
      type: object
      properties:
        owners:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationOwner'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    OrganizationOwner:
      description: A JSON document specifying an organization owner
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
        email:
          $ref: '#/components/schemas/Email'
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
        type:
          $ref: '#/components/schemas/UserType'
        creationTime:
          $ref: '#/components/schemas/Timestamp'
        deletionTime:
          $ref: '#/components/schemas/Timestamp'
      required:
        - userId
        - email
    RequestBodyToAddOrganizationOwner:
      description: A JSON document specifying a user to be made an organization owner
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
      required:
        - userId
    RequestBodyToRemoveOrganizationOwner:
      description: A JSON document specifying a user whose organization owner status is to be removed
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
      required:
        - userId
    RequestBodyToChangeOrganizationName:
      description: A JSON document specifying a request to change name of an organization
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/OrganizationName'
      required:
        - newName
    OrganizationOwnershipStatus:
      type: string
      enum:
        - OWNED
        - UNOWNED
      example: OWNED
      description: |
        Organization ownership status
    PagedResourceOrganizationOwnershipHistoryRecordListResponse:
      type: object
      properties:
        ownershipHistory:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationOwnershipHistoryRecord'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    OrganizationOwnershipHistoryRecord:
      description: A JSON document specifying an organization ownership history record
      type: object
      properties:
        eventTime:
          $ref: '#/components/schemas/Timestamp'
        modifiedBy:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            organizationId:
              $ref: '#/components/schemas/OrganizationId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
          required:
            - userId
        owner:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            organizationId:
              $ref: '#/components/schemas/OrganizationId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
          required:
            - userId
        operation:
          $ref: '#/components/schemas/OwnershipOperationType'
        internalOwners:
          description: Number of owners internal to the organization
          type: integer
        externalOwners:
          description: Number of owners external to the organization
          type: integer
      required:
        - eventTime
        - modifiedBy
        - owner
        - operation
        - internalOwners
        - externalOwners
    OwnershipOperationType:
      type: string
      enum:
        - ADD_OWNER
        - REMOVE_OWNER
      example: ADD_OWNER
      description: |
        Organization ownership operation type
    PagedResourceAppointedOwnersHistoryRecordListResponse:
      type: object
      properties:
        appointedOwnersHistory:
          type: array
          items:
            $ref: '#/components/schemas/AppointedOwnerHistoryRecord'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    AppointedOwnerHistoryRecord:
      description: A JSON document specifying an appointed owner history record
      type: object
      properties:
        eventTime:
          $ref: '#/components/schemas/Timestamp'
        modifiedBy:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            organizationId:
              $ref: '#/components/schemas/OrganizationId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
          required:
            - userId
        owner:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            organizationId:
              $ref: '#/components/schemas/OrganizationId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
          required:
            - userId
        operation:
          $ref: '#/components/schemas/OwnershipOperationType'
        appointedOwners:
          description: Number of owners appointed to the organization
          type: integer
      required:
        - eventTime
        - modifiedBy
        - owner
        - operation
        - appointedOwners
    UserId:
      description: The ID of the user.
      type: string
      example: a1b2c3d4
      maxLength: 255
    Firstname:
      description: Firstname for the user.
      type: string
      example: john
      minLength: 1
      maxLength: 255
    Lastname:
      description: Lastname for the user.
      type: string
      example: doe
      minLength: 1
      maxLength: 255
    Email:
      description: Email of the user.
      type: string
      pattern: '^[a-zA-Z0-9._%+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$'
      example: john_doe@server.org
      minLength: 1
      maxLength: 255
    AccountStatus:
      type: string
      enum:
        - ACTIVE
        - SUSPENDED
        - EXPIRED
        - RESTRICTED
      example: ACTIVE
      description: |
        Account status
    UserType:
      type: string
      enum:
        - INTERNAL
        - EXTERNAL
      example: INTERNAL
      description: |
        User Type
    RequestBodyToCreateUser:
      description: A JSON document specifying the user
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        email:
          $ref: '#/components/schemas/Email'
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
      required:
        - organizationId
        - email
    PagedResourceUserListResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUser'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceInternalUser:
      description: A JSON document specifying a user in an organization
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserId'
        tenantId:
          $ref: '#/components/schemas/TenantId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        email:
          $ref: '#/components/schemas/Email'
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
        account:
          type: object
          properties:
            status:
              $ref: '#/components/schemas/AccountStatus'
            neverExpires:
              type: boolean
            expiresAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - status
            - neverExpires
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - tenantId
        - organizationId
        - email
        - type
        - account
    ResourceUser:
      description: A JSON document specifying a user
      type: object
      allOf:
        - $ref: '#/components/schemas/ResourceInternalUser'
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/UserType'
      required:
        - type
    PagedResourceUserOrganizationListResponse:
      type: object
      properties:
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserOrganization'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserOrganization:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/OrganizationName'
    ResourceUserRoleListResponse:
      type: object
      properties:
        roles:
          type: array
          items:
            $ref: '#/components/schemas/UserRole'
      required:
        - roles
    PagedResourceGrantListResponse:
      type: object
      properties:
        grants:
          type: array
          items:
            $ref: '#/components/schemas/ResourceGrant'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceGrant:
      description: A JSON document specifying a grant
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/UserGrant'
            - $ref: '#/components/schemas/UserGroupGrant'
          discriminator:
            propertyName: type
    GrantType:
      type: string
      enum:
        - USER_GRANT
        - USER_GROUP_GRANT
      example: USER_GRANT
      description: |
        Grant type
    BaseGrant:
      description: A JSON document specifying common attributes of a grant
      type: object
      properties:
        type:
          $ref: '#/components/schemas/GrantType'
      discriminator:
        propertyName: type
        mapping:
          USER_GRANT: '#/components/schemas/UserGrant'
          USER_GROUP_GRANT: '#/components/schemas/UserGroupGrant'
      required:
        - type
    UserGrant:
      description: A JSON document specifying a user grant
      allOf:
        - $ref: '#/components/schemas/BaseGrant'
        - type: object
          properties:
            grant:
              $ref: '#/components/schemas/UserGrantDetails'
      required:
        - parameters
    UserGrantDetails:
      description: A JSON document specifying a user grant details
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserGrantId'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        node:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/NodeId'
            name:
              $ref: '#/components/schemas/NodeName'
            path:
              $ref: '#/components/schemas/NodePath'
            pathName:
              $ref: '#/components/schemas/NodePathName'
          required:
            - id
        product:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ProductId'
            name:
              $ref: '#/components/schemas/ProductName'
            path:
              $ref: '#/components/schemas/ProductPath'
            pathName:
              $ref: '#/components/schemas/ProductPathName'
          required:
            - id
      required:
        - id
        - role
        - node
        - product
    UserGroupGrant:
      description: A JSON document specifying a user group grant
      allOf:
        - $ref: '#/components/schemas/BaseGrant'
        - type: object
          properties:
            grant:
              $ref: '#/components/schemas/UserGroupGrantDetails'
      required:
        - parameters
    UserGroupGrantDetails:
      description: A JSON document specifying a user group grant details
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserGroupGrantId'
        userGroupId:
          $ref: '#/components/schemas/UserGroupId'
        userGroupName:
          $ref: '#/components/schemas/UserGroupName'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        node:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/NodeId'
            name:
              $ref: '#/components/schemas/NodeName'
            path:
              $ref: '#/components/schemas/NodePath'
            pathName:
              $ref: '#/components/schemas/NodePathName'
          required:
            - id
        product:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ProductId'
            name:
              $ref: '#/components/schemas/ProductName'
            path:
              $ref: '#/components/schemas/ProductPath'
            pathName:
              $ref: '#/components/schemas/ProductPathName'
          required:
            - id
      required:
        - id
        - userGroupId
        - role
        - node
        - product
    PagedResourceUserClientListResponse:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserClient'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserClient:
      description: A JSON document specifying a client
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ClientId'
      required:
        - id
    RequestToChangeUserName:
      description: A JSON document specifying a request to change first and/or last name of a user
      type: object
      properties:
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
      required:
        - firstname
        - lastname
    RequestToActivateUser:
      description: A JSON document specifying a request to change account expiration date of a user
      type: object
      properties:
        newExpiration:
          type: object
          properties:
            neverExpires:
              type: boolean
              example: false
            expirationDate:
              $ref: '#/components/schemas/Timestamp'
          required:
            - neverExpires
      required:
        - newExpiration
    ExternalUserStatus:
      description: The external user's status in an organization
      type: string
      enum:
        - REFERRED
        - ADMITTED
        - REVOKED
        - REJECTED
        - RESCINDED
      example: ADMITTED
    RequestBodyToAddExternalUser:
      description: A JSON document specifying a request to add an external user to an organization
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        referredUserId:
          $ref: '#/components/schemas/UserId'
        referrerUserId:
          $ref: '#/components/schemas/UserId'
        referrerComment:
          $ref: '#/components/schemas/ExternalUserReferrerComment'
      required:
        - organizationId
        - referredUserId
    PagedResourceExternalUserListResponse:
      type: object
      properties:
        externalUsers:
          type: array
          items:
            $ref: '#/components/schemas/ExternalUser'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ExternalUser:
      description: A JSON document specifying an external user
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ExternalUserId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        organizationName:
          $ref: '#/components/schemas/OrganizationName'
        referredUser:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
        referrerUser:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
        reviewerUser:
          type: object
          properties:
            userId:
              $ref: '#/components/schemas/UserId'
            firstname:
              $ref: '#/components/schemas/Firstname'
            lastname:
              $ref: '#/components/schemas/Lastname'
            email:
              $ref: '#/components/schemas/Email'
        referrerComment:
          $ref: '#/components/schemas/ExternalUserReferrerComment'
        reviewerComment:
          $ref: '#/components/schemas/ExternalUserReviewerComment'
        referredAt:
          $ref: '#/components/schemas/Timestamp'
        reviewedAt:
          $ref: '#/components/schemas/Timestamp'
        status:
          $ref: '#/components/schemas/ExternalUserStatus'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - organizationId
        - organizationName
        - referredUser
        - status
        - referredAt
    RequestBodyToAdmitExternalUser:
      description: A JSON document specifying a request to admit an external user from an organization
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/ExternalUserReviewerComment'
      required:
        - reviewerUserId
    RequestBodyToRevokeExternalUser:
      description: A JSON document specifying a request to revoke an external user from an organization
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/ExternalUserReviewerComment'
      required:
        - reviewerUserId
    RequestBodyToRejectExternalUser:
      description: A JSON document specifying a request to reject an external user from an organization
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/ExternalUserReviewerComment'
      required:
        - reviewerUserId
    PagedResourceExternalUserAuditListResponse:
      type: object
      properties:
        externalUserAudit:
          type: array
          items:
            $ref: '#/components/schemas/ExternalUserAudit'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ExternalUserAudit:
      description: A JSON document specifying a external user audit record
      type: object
      properties:
        eventTime:
          $ref: '#/components/schemas/Timestamp'
        externalUser:
          $ref: '#/components/schemas/ExternalUser'
      required:
        - eventTime
        - externalUser
    ExternalUserId:
      description: The ID of an external user.
      type: string
      example: a1b2c3d4
      maxLength: 255
    ExternalUserReferrerComment:
      description: The comment by referrer for the external user.
      type: string
      example: A technician for robot arms
      maxLength: 255
    ExternalUserReviewerComment:
      description: The reviewer comment for the external user.
      type: string
      example: We no longer require the user in our organization
      maxLength: 255
    UserGroupId:
      description: The ID of the usergroup.
      type: string
      example: a1b2c3d4
      maxLength: 255
    UserGroupName:
      description: Name for the usergroup.
      type: string
      example: service technicians
      minLength: 1
      maxLength: 255
    RequestBodyToCreateUserGroup:
      description: A JSON document specifying the usergroup
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/UserGroupName'
      required:
        - organizationId
        - name
    PagedResourceUserGroupListResponse:
      type: object
      properties:
        userGroups:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserGroup'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserGroup:
      description: A JSON document specifying a usergroup
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserGroupId'
        name:
          $ref: '#/components/schemas/UserGroupName'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
    PagedResourceUserInUserGroupListResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserInUserGroup'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserInUserGroup:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserId'
        email:
          $ref: '#/components/schemas/Email'
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
    RequestToChangeUserGroupName:
      description: A JSON document specifying a request to change name of a usergroup
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/UserGroupName'
      required:
        - newName
    RequestToAddUserToUserGroup:
      description: A JSON document specifying a request to add a user to a usergroup
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
      required:
        - userId
    RequestToRemoveUserFromUserGroup:
      description: A JSON document specifying a request to remove a user from a usergroup
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
      required:
        - userId
    ProductId:
      description: The ID of a product tree node.
      type: string
      example: a1b2c3d4
      maxLength: 255
    ProductName:
      description: Name of the product node.
      type: string
      example: PLC
      minLength: 1
      maxLength: 255
    ProductPath:
      description: The path of a product node.
      type: string
      example: /2/741/143
    ProductPathName:
      description: The names on the path of a product node.
      type: string
      example: /ALL/PLC/S7
    RequestBodyToCreateProduct:
      description: A JSON document specifying a product in tree
      type: object
      properties:
        name:
          $ref: '#/components/schemas/ProductName'
        parentId:
          $ref: '#/components/schemas/ProductId'
      required:
        - name
        - parentId
    RequestBodyToChangeProductName:
      description: A JSON document specifying a request to change name of a product
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/ProductName'
      required:
        - newName
    RequestBodyToMoveProduct:
      description: A JSON document specifying a request to move a product to a different parent product
      type: object
      properties:
        newParentId:
          $ref: '#/components/schemas/ProductId'
      required:
        - newParentId
    RequestBodyToCopyProduct:
      description: A JSON document specifying a request to copy a product
      type: object
      properties:
        targetParentId:
          $ref: '#/components/schemas/ProductId'
      required:
        - targetParentId
    PagedResourceProductListResponse:
      type: object
      properties:
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductNode'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ProductNode:
      description: A JSON document specifying a product in tree
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ProductId'
        name:
          $ref: '#/components/schemas/ProductName'
        parentId:
          $ref: '#/components/schemas/ProductId'
        path:
          $ref: '#/components/schemas/ProductPath'
        pathName:
          $ref: '#/components/schemas/ProductPathName'
        accessControl:
          $ref: '#/components/schemas/AccessControl'
        frozen:
          $ref: '#/components/schemas/Node/properties/frozen'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - path
        - pathName
        - accessControl
        - frozen
    NodeId:
      description: The ID of a tree node.
      type: string
      example: a1b2c3d4
      maxLength: 255
    NodeName:
      description: Name of the node.
      type: string
      example: Europe
      minLength: 1
      maxLength: 255
    NodePath:
      description: The path of a tree node.
      type: string
      example: /1/134/230
    NodePathName:
      description: The names on the path of a tree node.
      type: string
      example: /WORLD/Europe/Berlin
    RequestBodyToCreateNode:
      description: A JSON document specifying a node in tree
      type: object
      properties:
        name:
          $ref: '#/components/schemas/NodeName'
        parentId:
          $ref: '#/components/schemas/NodeId'
      required:
        - name
        - parentId
    PagedResourceNodeListResponse:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Node:
      description: A JSON document specifying a node in tree
      type: object
      properties:
        id:
          $ref: '#/components/schemas/NodeId'
        name:
          $ref: '#/components/schemas/NodeName'
        parentId:
          $ref: '#/components/schemas/NodeId'
        path:
          $ref: '#/components/schemas/NodePath'
        pathName:
          $ref: '#/components/schemas/NodePathName'
        accessControl:
          $ref: '#/components/schemas/AccessControl'
        frozen:
          description: 'Flag specifying a given node is fixed in a way that does not allow moving, removal or name change.'
          type: boolean
          default: false
          example: false
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - path
        - pathName
        - accessControl
        - frozen
    RequestBodyToChangeNodeName:
      description: A JSON document specifying a request to change name of a node
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/NodeName'
      required:
        - newName
    RequestBodyToMoveNode:
      description: A JSON document specifying a request to move a node to a different parent node
      type: object
      properties:
        newParentId:
          $ref: '#/components/schemas/NodeId'
      required:
        - newParentId
    SiteId:
      description: The ID of a tree site.
      type: string
      example: a1b2c3d4
      maxLength: 255
    RequestBodyToCreateSite:
      description: A JSON document specifying a site in tree
      type: object
      properties:
        name:
          $ref: '#/components/schemas/SiteName'
        nodeId:
          $ref: '#/components/schemas/NodeId'
      required:
        - name
        - nodeId
    PagedResourceSiteListResponse:
      type: object
      properties:
        sites:
          type: array
          items:
            $ref: '#/components/schemas/Site'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Site:
      description: A JSON document specifying a site in tree
      type: object
      properties:
        id:
          $ref: '#/components/schemas/SiteId'
        name:
          $ref: '#/components/schemas/SiteName'
        nodeId:
          $ref: '#/components/schemas/NodeId'
        connectivityLock:
          $ref: '#/components/schemas/ConnectivityLockStatus'
        path:
          $ref: '#/components/schemas/NodePath'
        pathName:
          $ref: '#/components/schemas/NodePathName'
        accessControl:
          $ref: '#/components/schemas/AccessControl'
        frozen:
          $ref: '#/components/schemas/Node/properties/frozen'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - nodeId
        - connectivityLock
        - path
        - pathName
        - accessControl
        - frozen
    RequestBodyToChangeSiteName:
      description: A JSON document specifying a request to change name of a site
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/SiteName'
      required:
        - newName
    RequestBodyToMoveSite:
      description: A JSON document specifying a request to move a site to a different node
      type: object
      properties:
        newNodeId:
          $ref: '#/components/schemas/NodeId'
      required:
        - newNodeId
    SiteName:
      description: Name of the site.
      type: string
      example: Berlin
      minLength: 1
      maxLength: 255
    GatewayId:
      description: The ID of a gateway.
      type: string
      example: a1b2c3d4
      maxLength: 255
    GatewayName:
      description: Name of the gateway.
      type: string
      example: Industrial PC
      minLength: 1
      maxLength: 255
    GatewayPath:
      description: The path of a gateway in the tree.
      type: string
      example: /1/134/230/a1b2c3d4
    GatewayPathName:
      description: The names on the path of a gateway in the tree.
      type: string
      example: /WORLD/Europe/Berlin/Industrial PC
    RequestBodyToCreateGateway:
      description: A JSON document specifying a gateway in tree
      type: object
      properties:
        name:
          $ref: '#/components/schemas/GatewayName'
        siteId:
          $ref: '#/components/schemas/SiteId'
        selfHost:
          type: object
          properties:
            name:
              $ref: '#/components/schemas/HostName'
            address:
              $ref: '#/components/schemas/Address'
            productId:
              $ref: '#/components/schemas/ProductId'
          required:
            - productId
      required:
        - name
        - siteId
        - selfHost
    PagedResourceGatewayListResponse:
      type: object
      properties:
        gateways:
          type: array
          items:
            $ref: '#/components/schemas/Gateway'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Gateway:
      description: A JSON document specifying a gateway in tree
      type: object
      properties:
        id:
          $ref: '#/components/schemas/GatewayId'
        name:
          $ref: '#/components/schemas/GatewayName'
        selfHostId:
          $ref: '#/components/schemas/HostId'
        siteId:
          $ref: '#/components/schemas/SiteId'
        connectivityLock:
          $ref: '#/components/schemas/ConnectivityLockStatus'
        gatewayPath:
          $ref: '#/components/schemas/GatewayPath'
        gatewayPathName:
          $ref: '#/components/schemas/GatewayPathName'
        accessControl:
          $ref: '#/components/schemas/AccessControl'
        frozen:
          $ref: '#/components/schemas/Node/properties/frozen'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - selfHostId
        - siteId
        - connectivityLock
        - gatewayPath
        - gatewayPathName
        - accessControl
        - frozen
    RequestBodyToChangeGatewayName:
      description: A JSON document specifying a request to change name of a gateway
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/GatewayName'
      required:
        - newName
    RequestBodyToMoveGateway:
      description: A JSON document specifying a request to move a gateway to a different site
      type: object
      properties:
        newSiteId:
          $ref: '#/components/schemas/SiteId'
      required:
        - newSiteId
    RequestBodyToCopyGateway:
      description: A JSON document specifying a request to copy a gateway
      type: object
      properties:
        targetSiteId:
          $ref: '#/components/schemas/SiteId'
      required:
        - targetSiteId
    HostId:
      description: The ID of a host.
      type: string
      example: a1b2c3d4
      maxLength: 255
    HostName:
      description: Name of the host.
      type: string
      example: PLC
      minLength: 1
      maxLength: 255
    Address:
      description: IP or address of the host.
      type: string
      example: 192.168.1.10
      minLength: 1
      maxLength: 255
    HostPath:
      description: The path of a host in the tree.
      type: string
      example: /1/134/230/a1b2c3d4/a1b2c3d4
    HostPathName:
      description: The names on the path of a host in the tree.
      type: string
      example: /WORLD/Europe/Berlin/Industrial PC/PLC
    RequestBodyToCreateHost:
      description: A JSON document specifying a host in tree
      type: object
      properties:
        name:
          $ref: '#/components/schemas/HostName'
        address:
          $ref: '#/components/schemas/Address'
        productId:
          $ref: '#/components/schemas/ProductId'
        gatewayId:
          $ref: '#/components/schemas/GatewayId'
      required:
        - name
        - address
        - productId
        - gatewayId
    PagedResourceHostListResponse:
      type: object
      properties:
        hosts:
          type: array
          items:
            $ref: '#/components/schemas/Host'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Host:
      description: A JSON document specifying a host in tree
      type: object
      properties:
        id:
          $ref: '#/components/schemas/HostId'
        name:
          $ref: '#/components/schemas/HostName'
        address:
          $ref: '#/components/schemas/Address'
        productId:
          $ref: '#/components/schemas/ProductId'
        connectivityLock:
          $ref: '#/components/schemas/ConnectivityLockStatus'
        hostPath:
          $ref: '#/components/schemas/HostPath'
        hostPathName:
          $ref: '#/components/schemas/HostPathName'
        productPath:
          $ref: '#/components/schemas/ProductPath'
        productPathName:
          $ref: '#/components/schemas/ProductPathName'
        gatewayId:
          $ref: '#/components/schemas/GatewayId'
        frozen:
          $ref: '#/components/schemas/Node/properties/frozen'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - name
        - address
        - productId
        - connectivityLock
        - hostPath
        - hostPathName
        - productPath
        - productPathName
        - gatewayId
        - frozen
    PagedResourceHostClientListResponse:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ResourceHostClient'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceHostClient:
      description: A JSON document specifying a client
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ClientId'
      required:
        - id
    RequestBodyToChangeHostName:
      description: A JSON document specifying a request to change name of a host
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/HostName'
      required:
        - newName
    RequestBodyToChangeHostAddress:
      description: A JSON document specifying a request to change address of a host
      type: object
      properties:
        newAddress:
          $ref: '#/components/schemas/Address'
      required:
        - newAddress
    RequestBodyToChangeProduct:
      description: A JSON document specifying a request to change product of a host
      type: object
      properties:
        newProductId:
          $ref: '#/components/schemas/ProductId'
      required:
        - newProductId
    TargetId:
      description: The ID of a target.
      type: string
      example: a1b2c3d4
      maxLength: 255
    RequestBodyToCreateTarget:
      description: A JSON document specifying a request to create a target
      type: object
      properties:
        hostId:
          $ref: '#/components/schemas/HostId'
        connectorId:
          $ref: '#/components/schemas/ConnectorId'
      required:
        - hostId
        - connectorId
    PagedResourceTargetListResponse:
      type: object
      properties:
        targets:
          type: array
          items:
            $ref: '#/components/schemas/Target'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Target:
      description: A JSON document specifying a target
      type: object
      properties:
        id:
          $ref: '#/components/schemas/TargetId'
        connector:
          type: object
          $ref: '#/components/schemas/ResourceConnector'
        host:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/HostId'
            name:
              $ref: '#/components/schemas/HostName'
            address:
              $ref: '#/components/schemas/Address'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - hostId
        - connectorId
    ClientId:
      description: The ID of a client.
      type: string
      example: a1b2c3d4
      maxLength: 255
    ClientOwnerType:
      type: string
      enum:
        - USER
        - HOST
        - TECHNICAL_USER
        - GLOBAL_TECHNICAL_USER
      example: HOST
      description: |
        Type of a client owner
    ClientOwnerId:
      description: The ID of the client's owner
      type: string
      example: a1b2c3d4
      maxLength: 255
    ClientOwnerName:
      description: 'The human readable name of the client''s owner. In a user client''s case it is the full name of the user. In case of a host client, it is a combination of the host name and the gateway.'
      type: string
      example: Factory Gateway / Host
      maxLength: 255
    PagedResourceClientListResponse:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/Client'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    RequestBodyToCreateClientPackage:
      description: A JSON document specifying a request to prepare a client package
      type: object
      properties:
        packageType:
          $ref: '#/components/schemas/ClientPackageType'
        clientVersion:
          $ref: '#/components/schemas/ClientVersion'
      required:
        - packageType
    RequestBodyToCreateClientConfiguration:
      description: A JSON document specifying a request to build a client configuration
      type: object
      properties:
        packageType:
          $ref: '#/components/schemas/ClientConfigPackageType'
        clientVersion:
          $ref: '#/components/schemas/ClientVersion'
        configCustomization:
          type: object
          description: A caller provided custom config that will be included within the generated config.
          properties:
            rootDirectory:
              type: string
              example: 'C:\mrs-client\'
            maxRootFolderSize:
              type: integer
              example: 10000000
            proxy:
              type: object
              properties:
                address:
                  type: string
                  example: 10.0.0.99
                port:
                  type: string
                  example: 8080
              required:
                - address
                - port
      required:
        - packageType
    RequestBodyToCreateClientBinary:
      description: A JSON document specifying a request to prepare a client binary
      type: object
      properties:
        packageType:
          $ref: '#/components/schemas/ClientBinaryPackageType'
        clientVersion:
          $ref: '#/components/schemas/ClientVersion'
      required:
        - packageType
    Client:
      description: A JSON document specifying a client
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ClientId'
        ownerType:
          $ref: '#/components/schemas/ClientOwnerType'
        ownerId:
          $ref: '#/components/schemas/ClientOwnerId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - ownerType
        - ownerId
    ClientVersion:
      description: 'Version of the client. Used to specify the version of the client for which the configuration should be downloaded. If it is set as *latest*, the client version is assumed to be the latest one. If the specified version is not found a Not Found(404) error occurs.'
      type: string
      example: 1.1.7
      maxLength: 255
    ClientPackageType:
      type: string
      enum:
        - X64_WINDOWS10
        - X64_DEBIAN9
        - X64_DEBIAN10
        - X86_DEBIAN10
        - AARCH64_DEBIAN10
        - X64_DEBIAN11
        - X86_DEBIAN11
        - AARCH64_DEBIAN11
      example: X64_WINDOWS10
      description: |
        Target platform for the client
    ClientConfigPackageType:
      type: string
      enum:
        - X64_WINDOWS10
        - X64_DEBIAN9
        - X64_DEBIAN10
        - X86_DEBIAN10
        - AARCH64_DEBIAN10
        - X64_DEBIAN11
        - X86_DEBIAN11
        - AARCH64_DEBIAN11
        - X64_DOCKER_IMG
        - X64_INDUSTRIALEDGE_APP
      example: X64_WINDOWS10
      description: |
        Target platform for the client
    ClientBinaryPackageType:
      type: string
      enum:
        - X64_WINDOWS10
        - X64_DEBIAN9
        - X64_DEBIAN10
        - X86_DEBIAN10
        - AARCH64_DEBIAN10
        - X64_DEBIAN11
        - X86_DEBIAN11
        - AARCH64_DEBIAN11
        - X64_DOCKER_IMG
        - X64_INDUSTRIALEDGE_APP
      example: X64_WINDOWS10
      description: |
        Target platform for the client
    TunnelId:
      $ref: '#/components/schemas/TargetId'
    TunnelStatus:
      type: string
      enum:
        - READY
        - ESTABLISHED
        - TERMINATED
      example: READY
      description: |
        Tunnel status
    RequestBodyToCreateTunnel:
      description: A JSON document specifying a request to create a tunnel
      type: object
      properties:
        requesterUserId:
          $ref: '#/components/schemas/UserId'
        sourceClientId:
          $ref: '#/components/schemas/ClientId'
        destinationClientId:
          $ref: '#/components/schemas/ClientId'
        targetId:
          $ref: '#/components/schemas/TargetId'
        customData:
          type: object
          example:
            puSourceInterfaces:
              - 192.168.1.10
          description: |
            Custom data for protocol specific requirements. For detailed information for *customData* for connector protocol, please check MindSphere Developer Documentation.
            e.g.: For *PU* '{"puSourceInterfaces": ["192.168.1.10"]}'
      required:
        - requesterUserId
        - sourceClientId
        - destinationClientId
        - targetId
    PagedResourceTunnelListResponse:
      type: object
      properties:
        tunnels:
          type: array
          items:
            $ref: '#/components/schemas/Tunnel'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Tunnel:
      description: A JSON document specifying a tunnel
      type: object
      properties:
        id:
          description: The ID of a tunnel.
          type: string
          example: a1b2c3d4
          maxLength: 255
        sourceClientId:
          $ref: '#/components/schemas/ClientId'
        destinationClientId:
          $ref: '#/components/schemas/ClientId'
        targetId:
          $ref: '#/components/schemas/TargetId'
        status:
          $ref: '#/components/schemas/TunnelStatus'
        connector:
          type: object
          properties:
            name:
              $ref: '#/components/schemas/ConnectorName'
            type:
              $ref: '#/components/schemas/ConnectorType'
            parameters:
              allOf:
                - oneOf:
                    - $ref: '#/components/schemas/DttParameters'
                    - $ref: '#/components/schemas/PUParameters'
                    - $ref: '#/components/schemas/RdpParameters'
                    - $ref: '#/components/schemas/WebAppParameters'
                    - $ref: '#/components/schemas/SshParameters'
                    - $ref: '#/components/schemas/VncParameters'
                    - $ref: '#/components/schemas/DttRParameters'
                    - $ref: '#/components/schemas/RdpParameters'
                  discriminator:
                    propertyName: type
        sourceClientName:
          $ref: '#/components/schemas/ClientOwnerName'
        destinationClientName:
          $ref: '#/components/schemas/ClientOwnerName'
        startedAt:
          $ref: '#/components/schemas/Timestamp'
        finishedAt:
          $ref: '#/components/schemas/Timestamp'
      required:
        - id
        - sourceClientId
        - destinationClientId
        - targetId
        - status
        - connector
        - sourceClientName
        - destinationClientName
        - startedAt
    PagedResourceGatewayHealthListResponse:
      type: object
      properties:
        gateways:
          type: array
          items:
            $ref: '#/components/schemas/GatewayHealth'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    GatewayHealth:
      description: A JSON document specifying a gateway
      type: object
      properties:
        gatewayId:
          $ref: '#/components/schemas/GatewayId'
        reportedAt:
          $ref: '#/components/schemas/Timestamp'
        status:
          $ref: '#/components/schemas/HealthStatus'
      required:
        - gatewayId
        - status
    PagedResourceHostHealthListResponse:
      type: object
      properties:
        hosts:
          type: array
          items:
            $ref: '#/components/schemas/HostHealth'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    HostHealth:
      description: A JSON document specifying a host
      type: object
      properties:
        hostId:
          $ref: '#/components/schemas/HostId'
        reportedAt:
          $ref: '#/components/schemas/Timestamp'
        status:
          $ref: '#/components/schemas/HealthStatus'
        components:
          type: array
          items:
            $ref: '#/components/schemas/ComponentHealth'
      required:
        - hostId
        - status
    PagedResourceClientHealthListResponse:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ClientHealth'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ClientHealth:
      description: A JSON document specifying a host
      type: object
      properties:
        clientId:
          $ref: '#/components/schemas/ClientId'
        reportedAt:
          $ref: '#/components/schemas/Timestamp'
        status:
          $ref: '#/components/schemas/HealthStatus'
        components:
          type: array
          items:
            $ref: '#/components/schemas/ComponentHealth'
      required:
        - clientId
        - status
    HealthStatus:
      type: string
      enum:
        - UNKNOWN
        - OK
        - WARNING
        - ERROR
      example: OK
      description: |
        Health status
    ComponentHealth:
      description: A JSON document specifying a component health
      type: object
      properties:
        componentId:
          $ref: '#/components/schemas/ComponentId'
        status:
          $ref: '#/components/schemas/HealthStatus'
        timestamp:
          $ref: '#/components/schemas/Timestamp'
        message:
          description: Health related message regarding the component.
          type: string
          example: Healthy
          minLength: 1
          maxLength: 1000
      required:
        - componentId
    ComponentId:
      description: The ID of a component.
      type: string
      example: a1b2c3d4
      maxLength: 255
    ConnectorId:
      description: The ID of a connector.
      type: string
      example: a1b2c3d4
      maxLength: 255
    ConnectorName:
      description: Name of the connector.
      type: string
      example: My connector
      minLength: 1
      maxLength: 255
    ConnectorType:
      type: string
      enum:
        - DTT
        - RDP
        - VNC
        - SSH
        - WEB_APP
        - PU
        - DTT_R
      example: DTT
      description: |
        Connector type
    ConnectorParametersSummary:
      $ref: '#/components/schemas/ConnectorType'
    PagedResourceConnectorListResponse:
      type: object
      properties:
        connectors:
          type: array
          items:
            $ref: '#/components/schemas/ResourceConnector'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceConnector:
      description: A JSON document specifying a connector
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/DttConnector'
            - $ref: '#/components/schemas/ProxyUnawareConnector'
            - $ref: '#/components/schemas/RdpConnector'
            - $ref: '#/components/schemas/WebAppConnector'
            - $ref: '#/components/schemas/SshConnector'
            - $ref: '#/components/schemas/VncConnector'
            - $ref: '#/components/schemas/DttRConnector'
          discriminator:
            propertyName: type
        - type: object
          properties:
            meta:
              $ref: '#/components/schemas/Metadata'
    RequestBodyToChangeConnectorName:
      description: A JSON document specifying a request to change name of a connector
      type: object
      properties:
        newName:
          $ref: '#/components/schemas/ConnectorName'
      required:
        - newName
    RequestBodyToChangeConnectorDescription:
      description: A JSON document specifying a request to change description of a connector
      type: object
      properties:
        newDescription:
          $ref: '#/components/schemas/ConnectorDescription'
      required:
        - newDescription
    RequestBodyToChangeConnectorIdleTimeout:
      description: A JSON document specifying a request to change idle timeout configuration of a connector
      type: object
      properties:
        seconds:
          type: integer
          description: Number of seconds before the connection times out
          minimum: 600
          default: 600
      required:
        - seconds
    RequestBodyToChangeConnectorParameters:
      description: A JSON document specifying a request to change parameters of a connector
      type: object
      properties:
        newParameters:
          oneOf:
            - $ref: '#/components/schemas/DttParameters'
            - $ref: '#/components/schemas/PUParameters'
            - $ref: '#/components/schemas/RdpParameters'
            - $ref: '#/components/schemas/WebAppParameters'
            - $ref: '#/components/schemas/SshParameters'
            - $ref: '#/components/schemas/VncParameters'
            - $ref: '#/components/schemas/DttRParameters'
      required:
        - newParameters
    ConnectorIdRo:
      description: The ID of a connector.
      type: string
      example: a1b2c3d4
      maxLength: 255
      readOnly: true
    ConnectorDescription:
      description: Description of the connector.
      type: string
      example: My connector
      maxLength: 255
    ConnectorPermissionRequired:
      description: The connector forces the permission to be acquired from a responsible user
      type: boolean
      default: false
    ConnectorIdleTimeout:
      description: 'A JSON document specifying a connection idle timeout, after which the connection is terminated by the system'
      type: object
      properties:
        infinite:
          type: boolean
          description: Indicate whether the timeout should be infinite
          default: false
        seconds:
          type: integer
          description: Number of seconds before the connection times out
          minimum: 600
          default: 600
      required:
        - infinite
    BaseConnector:
      description: A JSON document specifying common attributes of a connector
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ConnectorIdRo'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/ConnectorName'
        description:
          $ref: '#/components/schemas/ConnectorDescription'
        permissionRequired:
          $ref: '#/components/schemas/ConnectorPermissionRequired'
        idleTimeout:
          $ref: '#/components/schemas/ConnectorIdleTimeout'
        type:
          $ref: '#/components/schemas/ConnectorType'
      discriminator:
        propertyName: type
        mapping:
          DTT: '#/components/schemas/DttConnector'
          PU: '#/components/schemas/ProxyUnawareConnector'
          RDP: '#/components/schemas/RdpConnector'
          WEB_APP: '#/components/schemas/WebAppConnector'
          SSH: '#/components/schemas/SshConnector'
          VNC: '#/components/schemas/VncConnector'
          DTT_R: '#/components/schemas/DttRConnector'
      required:
        - id
        - nodeId
        - name
        - type
    DttConnector:
      description: A JSON document specifying a DTT connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/DttParameters'
      required:
        - parameters
    DttParameters:
      description: A JSON document specifying a DTT connector parameters
      type: object
      properties:
        mappings:
          type: array
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/DTTPortRange'
              - $ref: '#/components/schemas/DTTSinglePort'
            discriminator:
              propertyName: type
      required:
        - mappings
    BaseDTTPortMapping:
      description: A JSON document specifying common properties of a DTT port mapping
      properties:
        protocol:
          $ref: '#/components/schemas/NetworkProtocol'
        type:
          $ref: '#/components/schemas/PortMappingType'
      discriminator:
        propertyName: type
        mapping:
          RANGE: '#/components/schemas/DTTPortRange'
          SINGLE: '#/components/schemas/DTTSinglePort'
      required:
        - protocol
        - type
    DTTPortRange:
      description: A JSON document specifying a DTT port range mapping
      allOf:
        - $ref: '#/components/schemas/BaseDTTPortMapping'
        - type: object
          properties:
            listener:
              $ref: '#/components/schemas/PortRange'
            target:
              $ref: '#/components/schemas/PortRange'
      required:
        - listener
        - target
    DTTSinglePort:
      description: A JSON document specifying a DTT single port mapping
      allOf:
        - $ref: '#/components/schemas/BaseDTTPortMapping'
        - type: object
          properties:
            listener:
              $ref: '#/components/schemas/SinglePort'
            target:
              $ref: '#/components/schemas/SinglePort'
      required:
        - listener
        - target
    ProxyUnawareConnector:
      description: A JSON document specifying a Proxy Unaware connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/PUParameters'
      required:
        - parameters
    PUParameters:
      description: A JSON document specifying a Proxy Unaware connector parameters
      type: object
      properties:
        mappings:
          type: array
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/PUPortRange'
              - $ref: '#/components/schemas/PUSinglePort'
            discriminator:
              propertyName: type
        requestSourceInterface:
          description: Force users to request source interfaces from client
          type: boolean
          default: false
        sourceInterface:
          description: IPv4 address of the source interface (the default value is 127.0.0.1).
          type: string
          default: 127.0.0.1
      required:
        - mappings
    BasePUPortMapping:
      description: A JSON document specifying common properties of a PU port mapping
      properties:
        protocol:
          $ref: '#/components/schemas/NetworkProtocol'
        type:
          $ref: '#/components/schemas/PortMappingType'
      discriminator:
        propertyName: type
        mapping:
          RANGE: '#/components/schemas/PUPortRange'
          SINGLE: '#/components/schemas/PUSinglePort'
      required:
        - protocol
        - type
    PUPortRange:
      description: A JSON document specifying a Proxy Unaware port range mapping
      allOf:
        - $ref: '#/components/schemas/BasePUPortMapping'
        - $ref: '#/components/schemas/PortRange'
    PUSinglePort:
      description: A JSON document specifying a Proxy Unaware single port mapping
      allOf:
        - $ref: '#/components/schemas/BasePUPortMapping'
        - $ref: '#/components/schemas/SinglePort'
    RdpConnector:
      description: A JSON document specifying a RDP connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/RdpParameters'
      required:
        - parameters
    RdpParameters:
      description: A JSON document specifying a RDP connector parameters
      type: object
      properties:
        listenerPort:
          $ref: '#/components/schemas/Port'
        rdpProperties:
          type: object
          properties:
            authDomain:
              type: string
              maxLength: 255
              example: domain
            userName:
              type: string
              maxLength: 255
              example: myUsername
            bitDepth:
              type: number
              minimum: 0
              maximum: 32
            localFileShare:
              type: string
              maxLength: 255
              example: fileshare
            resolution:
              type: string
              maxLength: 255
              example: 1024x768
            useMultimon:
              type: number
              minimum: 0
              maximum: 1
      required:
        - listenerPort
    WebAppConnector:
      description: A JSON document specifying a WEB Connector connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/WebAppParameters'
      required:
        - parameters
    WebAppParameters:
      description: A JSON document specifying a WEB Connector connector parameters
      type: object
      properties:
        scheme:
          type: string
          enum:
            - http
            - https
        port:
          $ref: '#/components/schemas/Port'
        path:
          type: string
          maxLength: 1000
          example: /my/path/to/index.html
      required:
        - scheme
        - port
        - path
    SshConnector:
      description: A JSON document specifying an SSH connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/SshParameters'
      required:
        - parameters
    SshParameters:
      description: A JSON document specifying an SSH connector parameters
      type: object
      properties:
        listenerPort:
          $ref: '#/components/schemas/Port'
        targetPort:
          $ref: '#/components/schemas/Port'
      required:
        - listenerPort
        - targetPort
    VncConnector:
      description: A JSON document specifying a VNC connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/VncParameters'
      required:
        - parameters
    VncParameters:
      description: A JSON document specifying a VNC connector parameters
      type: object
      properties:
        listenerPort:
          $ref: '#/components/schemas/Port'
        targetPort:
          $ref: '#/components/schemas/Port'
      required:
        - listenerPort
        - targetPort
    DttRConnector:
      description: A JSON document specifying a DTT-R connector
      allOf:
        - $ref: '#/components/schemas/BaseConnector'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/DttRParameters'
      required:
        - parameters
    DttRParameters:
      description: A JSON document specifying a DTT-R connector parameters
      type: object
      properties:
        mappings:
          type: array
          items:
            type: object
            properties:
              protocol:
                $ref: '#/components/schemas/NetworkProtocol'
              listenerPort:
                $ref: '#/components/schemas/Port'
              targetPort:
                $ref: '#/components/schemas/Port'
              targetHost:
                type: string
                description: Hostname or IP address of the target host
                example: myUrlOrIP.com
            required:
              - protocol
              - listenerPort
              - targetPort
              - targetHost
        targetClientId:
          $ref: '#/components/schemas/ClientId'
      required:
        - mappings
        - targetClientId
    PortRange:
      type: object
      properties:
        portRange:
          type: object
          properties:
            first:
              $ref: '#/components/schemas/Port'
            last:
              $ref: '#/components/schemas/Port'
          required:
            - first
            - last
    SinglePort:
      type: object
      properties:
        singlePort:
          $ref: '#/components/schemas/Port'
    Port:
      type: number
      minimum: 0
      maximum: 65535
      example: 5000
    NetworkProtocol:
      type: string
      enum:
        - TCP
        - UDP
    PortMappingType:
      type: string
      enum:
        - RANGE
        - SINGLE
    UserGrantRole:
      type: string
      enum:
        - ORGANIZATION_ADMIN
        - SITE_OWNER
        - REMOTE_USER
      example: ORGANIZATION_ADMIN
      description: |
        User role that can be given for a grant
    UserGrantId:
      description: The ID of a grant.
      type: string
      example: a1b2c3d4
      maxLength: 255
    RequestBodyToCreateUserGrant:
      description: A JSON document specifying a user grant
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        nodeId:
          $ref: '#/components/schemas/NodeId'
        productId:
          $ref: '#/components/schemas/ProductId'
      required:
        - userId
        - role
        - nodeId
        - productId
    PagedResourceUserGrantListResponse:
      type: object
      properties:
        userGrants:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserGrant'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserGrant:
      description: A JSON document specifying a user grant
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserGrantId'
        userId:
          $ref: '#/components/schemas/UserId'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        node:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/NodeId'
            name:
              $ref: '#/components/schemas/NodeName'
            path:
              $ref: '#/components/schemas/NodePath'
            pathName:
              $ref: '#/components/schemas/NodePathName'
          required:
            - id
        product:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ProductId'
            name:
              $ref: '#/components/schemas/ProductName'
            path:
              $ref: '#/components/schemas/ProductPath'
            pathName:
              $ref: '#/components/schemas/ProductPathName'
          required:
            - id
      required:
        - id
        - userId
        - role
        - node
        - product
    UserGroupGrantId:
      description: The ID of a grant.
      type: string
      example: a1b2c3d4
      maxLength: 255
    RequestBodyToCreateUserGroupGrant:
      description: A JSON document specifying a usergroup grant
      type: object
      properties:
        userGroupId:
          $ref: '#/components/schemas/UserGroupId'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        nodeId:
          $ref: '#/components/schemas/NodeId'
        productId:
          $ref: '#/components/schemas/ProductId'
      required:
        - userGroupId
        - role
        - nodeId
        - productId
    PagedResourceUserGroupGrantListResponse:
      type: object
      properties:
        userGroupGrants:
          type: array
          items:
            $ref: '#/components/schemas/ResourceUserGroupGrant'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    ResourceUserGroupGrant:
      description: A JSON document specifying a usergroup grant
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserGroupGrantId'
        userGroupId:
          $ref: '#/components/schemas/UserGroupId'
        userGroupName:
          $ref: '#/components/schemas/UserGroupName'
        role:
          $ref: '#/components/schemas/UserGrantRole'
        node:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/NodeId'
            name:
              $ref: '#/components/schemas/NodeName'
            path:
              $ref: '#/components/schemas/NodePath'
            pathName:
              $ref: '#/components/schemas/NodePathName'
          required:
            - id
        product:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ProductId'
            name:
              $ref: '#/components/schemas/ProductName'
            path:
              $ref: '#/components/schemas/ProductPath'
            pathName:
              $ref: '#/components/schemas/ProductPathName'
          required:
            - ids
      required:
        - id
        - userGroupId
        - role
        - node
        - product
    RequestBodyToCreatePermissionRequest:
      description: A JSON document specifying a request to create a new permission request
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        requesterUserId:
          $ref: '#/components/schemas/UserId'
        comment:
          $ref: '#/components/schemas/PermissionRequestRequesterComment'
        permission:
          type: object
          oneOf:
            - $ref: '#/components/schemas/CreateTunnelPermission'
          discriminator:
            propertyName: subject
      required:
        - organizationId
        - requesterUserId
        - permission
    PagedResourcePermissionRequestListResponse:
      type: object
      properties:
        permissionRequests:
          type: array
          items:
            $ref: '#/components/schemas/PermissionRequest'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    PermissionRequest:
      description: A JSON document specifying a base permission request
      type: object
      properties:
        id:
          $ref: '#/components/schemas/PermissionRequestId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        status:
          $ref: '#/components/schemas/PermissionRequestStatus'
        request:
          type: object
          properties:
            requesterUserId:
              $ref: '#/components/schemas/UserId'
            requesterFirstname:
              $ref: '#/components/schemas/Firstname'
            requesterLastname:
              $ref: '#/components/schemas/Lastname'
            comment:
              $ref: '#/components/schemas/PermissionRequestRequesterComment'
            requestedAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - requesterUserId
        review:
          type: object
          properties:
            dueDate:
              $ref: '#/components/schemas/Timestamp'
            reviewerUserId:
              $ref: '#/components/schemas/UserId'
            requesterFirstname:
              $ref: '#/components/schemas/Firstname'
            requesterLastname:
              $ref: '#/components/schemas/Lastname'
            comment:
              $ref: '#/components/schemas/PermissionRequestReviewerComment'
            reviewedAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - reviewDueDate
        completion:
          type: object
          properties:
            completed:
              type: boolean
              example: true
              description: The flag signifying whether the request is still actionable or is in a final state where there are no possible actions to take.
            completedAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - completed
        approval:
          type: object
          properties:
            approvedAt:
              $ref: '#/components/schemas/Timestamp'
            expiresAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - date
            - expiresAt
        permission:
          type: object
          oneOf:
            - $ref: '#/components/schemas/CreateTunnelPermission'
          discriminator:
            propertyName: subject
      required:
        - id
        - organizationId
        - status
        - subject
        - request
        - review
        - completion
        - permission
    PermissionRequestId:
      description: The ID of a permission request.
      type: string
      example: a1b2c3d4
      maxLength: 255
    PermissionRequestStatus:
      description: Status of the permission requests
      type: string
      enum:
        - PENDING
        - IGNORED
        - WITHDRAWN
        - REJECTED
        - APPROVED
        - RETURNED
        - REVOKED
        - EXPIRED
        - INVALIDATED
      example: REVOKED
    PermissionRequestSubject:
      type: string
      enum:
        - CREATE_TUNNEL
      example: CREATE_TUNNEL
      description: |
        Specific subject for the permission request
    BasePermission:
      description: A JSON document specifying a base permission
      type: object
      properties:
        subject:
          $ref: '#/components/schemas/PermissionRequestSubject'
      discriminator:
        propertyName: subject
        mapping:
          CREATE_TUNNEL: '#/components/schemas/CreateTunnelPermission'
      required:
        - subject
    CreateTunnelPermission:
      description: A payload JSON document specifying details of a tunnel creation permission request.
      allOf:
        - $ref: '#/components/schemas/BasePermission'
        - type: object
          properties:
            details:
              type: object
              properties:
                destinationClientId:
                  $ref: '#/components/schemas/ClientId'
                targetId:
                  $ref: '#/components/schemas/TargetId'
                enriched:
                  type: object
                  readOnly: true
                  properties:
                    connectorName:
                      $ref: '#/components/schemas/ConnectorName'
                    connectorType:
                      $ref: '#/components/schemas/ConnectorType'
                    gatewayName:
                      $ref: '#/components/schemas/GatewayName'
                    hostName:
                      $ref: '#/components/schemas/HostName'
                  required:
                    - destinationClientId
                    - targetId
      required:
        - details
    PermissionRequestRequesterComment:
      description: The comment by requester for the permission request.
      type: string
      example: Remote access request for production machine
      maxLength: 255
    PermissionRequestReviewerComment:
      description: The reviewer comment for the permission request.
      type: string
      example: Access is granted for 48 hours
      maxLength: 255
    RequestBodyToSetRequesterComment:
      description: A JSON document specifying a request to set requester comment on a permission request
      type: object
      properties:
        requesterComment:
          $ref: '#/components/schemas/PermissionRequestRequesterComment'
      required:
        - requesterComment
    RequestBodyToSetReviewerComment:
      description: A JSON document specifying a request to set reviewer comment on a permission request
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/PermissionRequestReviewerComment'
      required:
        - reviewerUserId
        - reviewerComment
    RequestBodyToApprovePermissionRequest:
      description: A JSON document specifying a request to approve a pending permission request
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/PermissionRequestReviewerComment'
        expiresAt:
          $ref: '#/components/schemas/Timestamp'
      required:
        - reviewerUserId
        - expiresAt
    RequestBodyToRejectPermissionRequest:
      description: A JSON document specifying a request to reject a pending permission request
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/PermissionRequestReviewerComment'
      required:
        - reviewerUserId
    RequestBodyToRevokePermissionRequest:
      description: A JSON document specifying a request to revoke an approved permission request
      type: object
      properties:
        reviewerUserId:
          $ref: '#/components/schemas/UserId'
        reviewerComment:
          $ref: '#/components/schemas/PermissionRequestReviewerComment'
      required:
        - reviewerUserId
    ExternalSystemType:
      type: string
      enum:
        - IH_ASSET_MANAGEMENT
        - SX_ASSET_MANAGEMENT
      example: IH_ASSET_MANAGEMENT
      description: |
        External system type
    ResourceId:
      description: The ID of a resource
      type: string
      example: a1b2c3d4
      maxLength: 255
    ResourceType:
      description: The type of a resource
      type: string
      example: GATEWAY
      maxLength: 255
    RequestBodyToCreateIntegration:
      description: A JSON document specifying an integration
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        externalSystemType:
          $ref: '#/components/schemas/ExternalSystemType'
      required:
        - organizationId
        - externalSystemType
    PagedResourceIntegrationListResponse:
      type: object
      properties:
        integrations:
          type: array
          items:
            $ref: '#/components/schemas/Integration'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    Integration:
      description: A JSON document specifying an integration
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IntegrationId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        externalSystemType:
          $ref: '#/components/schemas/ExternalSystemType'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - organizationId
        - externalSystemType
    PagedResourceIntegrationMappingListResponse:
      type: object
      properties:
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/ResourceIntegrationMapping'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    IntegrationMapping:
      description: A JSON document specifying an integration mapping
      type: object
      properties:
        internal:
          $ref: '#/components/schemas/ResourceDescriptor'
        external:
          $ref: '#/components/schemas/ResourceDescriptor'
      required:
        - internal
        - external
    ResourceIntegrationMapping:
      description: A JSON document specifying an integration mapping
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ResourceId'
        internal:
          $ref: '#/components/schemas/ResourceDescriptor'
        external:
          $ref: '#/components/schemas/ResourceDescriptor'
      required:
        - id
        - internal
        - external
    ResourceDescriptor:
      description: A JSON document specifying a resource description
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ResourceId'
        type:
          $ref: '#/components/schemas/ResourceType'
      required:
        - id
        - type
    RequestBodyToAddIntegrationMapping:
      description: A JSON document specifying a request to add an integration mapping
      type: object
      properties:
        mapping:
          $ref: '#/components/schemas/IntegrationMapping'
      required:
        - mapping
    RequestBodyToRemoveIntegrationMapping:
      description: A JSON document specifying a request to remove an integration mapping
      type: object
      properties:
        mappingId:
          $ref: '#/components/schemas/ResourceId'
      required:
        - mappingId
    IntegrationId:
      description: The ID of an integration
      type: string
      example: a1b2c3d4
      maxLength: 255
    PagedResourceMappingQueryItemListResponse:
      type: object
      properties:
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/MappingQueryItem'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    MappingQueryItem:
      description: A JSON document specifying an integration mapping
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ResourceId'
        integrationId:
          $ref: '#/components/schemas/IntegrationId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        externalSystemType:
          $ref: '#/components/schemas/ExternalSystemType'
        internal:
          $ref: '#/components/schemas/ResourceDescriptor'
        external:
          $ref: '#/components/schemas/ResourceDescriptor'
      required:
        - id
        - integrationId
        - organizationId
        - internal
        - external
    RequestBodyToCreateTechnicalUser:
      description: A JSON document specifying a request to create a new technical user
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/TechnicalUserName'
      required:
        - organizationId
        - name
    PagedResourceTechnicalUserListResponse:
      type: object
      properties:
        technicalUsers:
          type: array
          items:
            $ref: '#/components/schemas/TechnicalUser'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    TechnicalUser:
      description: A JSON document specifying a technical user
      type: object
      properties:
        id:
          $ref: '#/components/schemas/TechnicalUserId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        name:
          $ref: '#/components/schemas/TechnicalUserName'
        meta:
          $ref: '#/components/schemas/Metadata'
      required:
        - id
        - organizationId
        - name
    PagedResourceTechnicalUserClientListResponse:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/TechnicalUserClient'
        meta:
          type: object
          properties:
            page:
              $ref: '#/components/schemas/Page'
    TechnicalUserClient:
      description: A JSON document specifying a technical user client
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ClientId'
      required:
        - id
    RequestBodyToRemoveTechnicalUserClient:
      description: A JSON document specifying a request to remove a technical user client
      type: object
      properties:
        clientId:
          $ref: '#/components/schemas/ClientId'
      required:
        - clientId
    TechnicalUserId:
      description: The ID of the technical user.
      type: string
      example: a1b2c3d4
      maxLength: 255
    TechnicalUserName:
      description: Name for the technical user.
      type: string
      example: Technical user
      maxLength: 255
    ResourceUserSession:
      description: A JSON document specifying a user session info
      type: object
      properties:
        userId:
          $ref: '#/components/schemas/UserId'
        tenantId:
          $ref: '#/components/schemas/TenantId'
        email:
          $ref: '#/components/schemas/Email'
        firstname:
          $ref: '#/components/schemas/Firstname'
        lastname:
          $ref: '#/components/schemas/Lastname'
        serviceOwner:
          type: boolean
        homeOrganization:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/OrganizationId'
            name:
              $ref: '#/components/schemas/OrganizationName'
        account:
          type: object
          properties:
            status:
              $ref: '#/components/schemas/AccountStatus'
            neverExpires:
              type: boolean
            expiresAt:
              $ref: '#/components/schemas/Timestamp'
          required:
            - status
            - neverExpires
      required:
        - userId
        - tenantId
        - organizationId
        - email
        - acount
    UserRole:
      type: string
      enum:
        - ORGANIZATION_OWNER
        - ORGANIZATION_ADMIN
        - SITE_OWNER
        - REMOTE_USER
      example: ORGANIZATION_ADMIN
      description: |
        User role
    AccessLevel:
      type: string
      enum:
        - PARTIAL
        - FULL
      example: FULL
      description: |
        Level of access a user has for a particular resource.
    AccessControl:
      type: object
      properties:
        accessLevel:
          $ref: '#/components/schemas/AccessLevel'
      readOnly: true
    ConnectivityLockStatus:
      type: string
      enum:
        - UNLOCKED
        - LOCKED
      example: UNLOCKED
      description: |
        Connectivity lock status
    Timestamp:
      description: 'A datetime with a format according to ISO 8601 extended date/time format ''YYYY-MM-DDThh:mm:ss.sssZ''.'
      type: string
      format: date-time
      example: '2021-08-25T08:55:18.687Z'
    PeriodLength:
      description: A duration expressed in the ISO 8601 standard.
      type: string
      example: P1M
    Metadata:
      type: object
      properties:
        version:
          type: string
          description: Resource version used for concurrency control.
          example: 1
      readOnly: true
    Page:
      type: object
      properties:
        totalPages:
          type: integer
        number:
          type: integer
        size:
          type: integer
        elements:
          type: integer
        totalElements:
          type: integer
    Errors:
      description: Error response body model.
      type: object
      properties:
        errors:
          description: Concrete error codes and messages are defined at operation error response descriptions in this API specification.
          type: array
          items:
            type: object
            properties:
              code:
                description: Unique error code. Every code is bound to one (parametrized) message.
                type: string
                format: cnx.core.<context>.<suffix>
                example: cnx.core.users.exampleCode
              logref:
                description: Logging correlation ID for debugging purposes.
                type: string
                example: 0bff7e7a-cd25-4576-9908-4180ef086174
              message:
                description: Human readable error message in English.
                type: string
                example: Example error message with parameter value 100
              messageParameters:
                description: |
                  In case an error message is parametrized, the parameter names and values are returned for, e.g., localization purposes. The parametrized error messages are defined at the operation error response descriptions in this API specification. Parameters are denoted by named placeholders '{\<parameter name\>}' in the  message specifications. At runtime, returned message placeholders are substituted by actual parameter values.
                type: array
                items:
                  description: Message parameter
                  type: object
                  properties:
                    name:
                      description: Name of message parameter as specified in parametrized error message.
                      type: string
                    value:
                      description: Value of message parameter as substituted in returned error message.
                      type: string
                example:
                  - name: exampleParameterName
                    value: '100'
  securitySchemes:
    connexus_roles:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.roles.internal: |
              Grant user role of internal (technical) user

              "permissions": [
                "cnx.t.c",
                "cnx.t.r",
                "cnx.t.u",
                "cnx.t.d",
                "cnx.t.l",
                "cnx.ft.d",
                "cnx.gtu.c",
                "cnx.gtu.r",
                "cnx.gtu.u",
                "cnx.gtu.d",
                "cnx.gtu.l",
                "cnx.gtu.am",
                "cnx.gtu.rm"
              ]
            cnx.roles.serviceowner: |
              Grant user role of service owner

              "permissions": [
                "cnx.o.c",
                "cnx.o.d",
                "cnx.o.l",
                "cnx.o.ho",
                "cnx.eu.c",
                "cnx.eu.u",
                "cnx.eu.d",
                "mdsp:core:connexus.orguser"
              ]
            cnx.roles.orguser: |
              Grant user role of organization user

              "permissions": [
                "cnx.t.r",
                "cnx.o.r",
                "cnx.o.u",
                "cnx.o.ao",
                "cnx.o.ro",
                "cnx.u.c",
                "cnx.u.r",
                "cnx.u.u",
                "cnx.u.d",
                "cnx.u.l",
                "cnx.eu.r",
                "cnx.eu.l",
                "cnx.eu.ad",
                "cnx.eu.rv",
                "cnx.eu.rj",
                "cnx.ug.c",
                "cnx.ug.r",
                "cnx.ug.u",
                "cnx.ug.d",
                "cnx.ug.l",
                "cnx.ug.au",
                "cnx.ug.ru",
                "cnx.p.c",
                "cnx.p.r",
                "cnx.p.u",
                "cnx.p.d",
                "cnx.p.l",
                "cnx.n.c",
                "cnx.n.r",
                "cnx.n.u",
                "cnx.n.d",
                "cnx.n.l",
                "cnx.s.c",
                "cnx.s.r",
                "cnx.s.u",
                "cnx.s.d",
                "cnx.s.l",
                "cnx.s.lk",
                "cnx.s.ulk",
                "cnx.gw.c",
                "cnx.gw.r",
                "cnx.gw.u",
                "cnx.gw.d",
                "cnx.gw.l",
                "cnx.gw.lk",
                "cnx.gw.ulk",
                "cnx.h.c",
                "cnx.h.r",
                "cnx.h.u",
                "cnx.h.d",
                "cnx.h.l",
                "cnx.h.lk",
                "cnx.h.ulk",
                "cnx.tg.c",
                "cnx.tg.r",
                "cnx.tg.u",
                "cnx.tg.d",
                "cnx.tg.l",
                "cnx.cl.r",
                "cnx.cl.pkg",
                "cnx.cl.cfg",
                "cnx.cl.rst",
                "cnx.cl.rc",
                "cnx.cl.st",
                "cnx.tn.c",
                "cnx.tn.r",
                "cnx.tn.l",
                "cnx.tn.rt",
                "cnx.mon.r",
                "cnx.a.c",
                "cnx.a.r",
                "cnx.a.u",
                "cnx.a.d",
                "cnx.a.l",
                "cnx.gu.c",
                "cnx.gu.r",
                "cnx.gu.d",
                "cnx.gu.l",
                "cnx.gug.g",
                "cnx.gug.r",
                "cnx.gug.d",
                "cnx.gug.l",
                "cnx.ft.c",
                "cnx.ft.r",
                "cnx.ft.l",
                "cnx.ft.ls",
                "cnx.pr.c",
                "cnx.pr.r",
                "cnx.pr.l",
                "cnx.pr.rqc",
                "cnx.pr.w",
                "cnx.pr.ret",
                "cnx.pr.rwc",
                "cnx.pr.a",
                "cnx.pr.rj",
                "cnx.pr.rv",
                "cnx.pr.pc",
                "cnx.sub.c",
                "cnx.sub.r",
                "cnx.sub.u",
                "cnx.sub.d",
                "cnx.sub.l",
                "cnx.au.r",
                "cnx.au.l",
                "cnx.auf.r",
                "cnx.auf.l",
                "cnx.auf.b",
                "cnx.int.c",
                "cnx.int.r",
                "cnx.int.u",
                "cnx.int.d",
                "cnx.int.l",
                "cnx.int.am",
                "cnx.int.rm",
                "cnx.tu.c",
                "cnx.tu.r",
                "cnx.tu.u",
                "cnx.tu.d",
                "cnx.tu.l",
                "cnx.tu.am",
                "cnx.tu.rm",
                "cnx.lim.cq",
                "cnx.lim.rg",
                "cnx.lim.pg",
                "cnx.lim.rc",
                "cnx.lim.qf",
                "cnx.lim.qs",
                "cnx.sm.r",
                "cnx.par.r",
                "cnx.ac.c",
                "cnx.ac.r",
                "cnx.ac.u",
                "cnx.ac.d",
                "cnx.ac.l"
              ]
    tenant_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.t.c: Grant user permission to create a new tenant
            cnx.t.r: Grant user permission to retrieve a tenant
            cnx.t.u: Grant user permission to update a tenant
            cnx.t.d: Grant user permission to delete a tenant
            cnx.t.l: Grant user permission to list tenants
    organization_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.o.c: Grant user permission to create a new organization
            cnx.o.r: Grant user permission to retrieve an organization
            cnx.o.u: Grant user permission to update an organization
            cnx.o.d: Grant user permission to delete an organization
            cnx.o.l: Grant user permission to list organizations
            cnx.o.ao: Grant user permission to add an organization owner
            cnx.o.ro: Grant user permission to remove an organization owner
            cnx.o.ho: Grant user permission to retrieve history of an organization
    user_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.u.c: Grant user permission to create a new user
            cnx.u.r: Grant user permission to retrieve a user
            cnx.u.u: Grant user permission to update a user
            cnx.u.d: Grant user permission to delete a user
            cnx.u.l: Grant user permission to list users
    external_user_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.eu.c: Grant user permission to create a new external user
            cnx.eu.r: Grant user permission to retrieve an external user
            cnx.eu.u: Grant user permission to update an external user
            cnx.eu.d: Grant user permission to delete an external user
            cnx.eu.l: Grant user permission to list external users
            cnx.eu.ad: Grant user permission to admit an external user to an organization
            cnx.eu.rv: Grant user permission to revoke an admitted external user from an organization
            cnx.eu.rj: Grant user permission to reject an external user
    user_group_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.ug.c: Grant user permission to create a new usergroup
            cnx.ug.r: Grant user permission to retrieve a usergroup
            cnx.ug.u: Grant user permission to update a usergroup
            cnx.ug.d: Grant user permission to delete a usergroup
            cnx.ug.l: Grant user permission to list usergroups
            cnx.ug.au: Grant user permission to add a user to a usergroup
            cnx.ug.ru: Grant user permission to remove a user from a usergroup
    product_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.p.c: Grant user permission to create a new product
            cnx.p.r: Grant user permission to retrieve a product
            cnx.p.u: Grant user permission to update a product
            cnx.p.d: Grant user permission to delete a product
            cnx.p.l: Grant user permission to list products
    node_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.n.c: Grant user permission to create a new node
            cnx.n.r: Grant user permission to retrieve a node
            cnx.n.u: Grant user permission to update a node
            cnx.n.d: Grant user permission to delete a node
            cnx.n.l: Grant user permission to list nodes
    site_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.s.c: Grant user permission to create a new site
            cnx.s.r: Grant user permission to retrieve a site
            cnx.s.u: Grant user permission to update a site
            cnx.s.d: Grant user permission to delete a site
            cnx.s.l: Grant user permission to list sites
            cnx.s.lk: Grant user permission to lock site connectivity
            cnx.s.ulk: Grant user permission to unlock site connectivity
    gateway_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.gw.c: Grant user permission to create a new gateway
            cnx.gw.r: Grant user permission to retrieve a gateway
            cnx.gw.u: Grant user permission to update a gateway
            cnx.gw.d: Grant user permission to delete a gateway
            cnx.gw.l: Grant user permission to list gateways
            cnx.gw.lk: Grant user permission to lock gateway connectivity
            cnx.gw.ulk: Grant user permission to unlock gateway connectivity
    host_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.h.c: Grant user permission to create a new host
            cnx.h.r: Grant user permission to retrieve a host
            cnx.h.u: Grant user permission to update a host
            cnx.h.d: Grant user permission to delete a host
            cnx.h.l: Grant user permission to list hosts
            cnx.h.lk: Grant user permission to lock host connectivity
            cnx.h.ulk: Grant user permission to unlock host connectivity
    target_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.tg.c: Grant user permission to create a new target
            cnx.tg.r: Grant user permission to retrieve a target
            cnx.tg.u: Grant user permission to update a target
            cnx.tg.d: Grant user permission to delete a target
            cnx.tg.l: Grant user permission to list targets
    client_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.cl.r: Grant user permission to retrieve a client
            cnx.cl.pkg: Grant user permission to package a client
            cnx.cl.cfg: Grant user permission to retrieve a client configuration
            cnx.cl.rst: Grant user permission to reset location of a client
            cnx.cl.rc: Grant user permission to revoke client credentials
            cnx.cl.st: Grant user permission to sync time of a client
    connector_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.a.c: Grant user permission to create a new connector
            cnx.a.r: Grant user permission to retrieve a connector
            cnx.a.u: Grant user permission to update a connector
            cnx.a.d: Grant user permission to delete a connector
            cnx.a.l: Grant user permission to list connectors
    tunnel_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.tn.c: Grant user permission to create a new tunnel
            cnx.tn.r: Grant user permission to retrieve a tunnel
            cnx.tn.l: Grant user permission to list tunnels
            cnx.tn.rt: Grant user permission to request termination of a tunnel
    monitoring:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.mon.r: Grant user permission to retrieve a host
    user_grant_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.gu.c: Grant user permission to create a new user grant
            cnx.gu.r: Grant user permission to retrieve a user grant
            cnx.gu.d: Grant user permission to delete a user grant
            cnx.gu.l: Grant user permission to list user grants
    user_group_grant_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.gug.c: Grant user permission to create a new usergroup grant
            cnx.gug.r: Grant user permission to retrieve a usergroup grant
            cnx.gug.d: Grant user permission to delete a usergroup grant
            cnx.gug.l: Grant user permission to list usergroup grant
    permission_request_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.pr.c: Grant user permission to create a new permission request
            cnx.pr.r: Grant user permission to retrieve a permission request
            cnx.pr.l: Grant user permission to list permission requests
            cnx.pr.rqc: Grant user permission to set requester comment for a permission request
            cnx.pr.w: Grant user permission to withdraw a pending permission request
            cnx.pr.ret: Grant user permission to return an approved permission request
            cnx.pr.rwc: Grant user permission to set reviewer comment for a permission request
            cnx.pr.a: Grant user permission to approve a pending permission request
            cnx.pr.rj: Grant user permission to reject a pending permission request
            cnx.pr.rv: Grant user permission to revoke an approved permission request
            cnx.pr.pc: Grant user permission to create a preapproved permission request
    integration_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.int.c: Grant user permission to create a new integration
            cnx.int.r: Grant user permission to retrieve an integration
            cnx.int.u: Grant user permission to update an integration
            cnx.int.d: Grant user permission to delete an integration
            cnx.int.l: Grant user permission to list integrations
            cnx.int.am: Grant user permission to add an integration mapping
            cnx.int.rm: Grant user permission to remove an integration mapping
    technical_user_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.tu.c: Grant user permission to create a new technical user
            cnx.tu.r: Grant user permission to retrieve a technical user
            cnx.tu.u: Grant user permission to update a technical user
            cnx.tu.d: Grant user permission to delete a technical user
            cnx.tu.l: Grant user permission to list technical users
            cnx.tu.am: Grant user permission to add a technical user client
            cnx.tu.rm: Grant user permission to remove a technical user client
    session_management:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://oauth.simple.api/authorization'
          tokenUrl: 'https://oauth.simple.api/token'
          scopes:
            cnx.sm.r: Grant user permission to retrieve user session information
