openapi: 3.0.0
tags:
  - name: repositories
  - name: endpoints
  - name: local endpoints
  - name: draft endpoints
  - name: executions
  - name: public endpoint
  - name: repository events
  - name: endpoint events
  - name: installations
  - name: permissions
  - name: api-keys
  - name: scopes
info:
  title: API Server
  description: RAW API Server.
  version: 1.0.0
paths:
  /raw/1/api/admin/permissions/{user_email}:
    get:
      tags:
        - permissions
      summary: Permissions of a user.
      description: Returns the permissions a user holds.
      parameters:
        - in: path
          name: user_email
          schema:
            type: string
          description: User identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionMeta'
        '403':
          description: you do not have privileges to access this resource
        '404':
          description: resource not found
    put:
      tags:
        - permissions
      summary: Edit permissions of a user.
      description: Edit the permissions a user holds.
      parameters:
        - in: path
          name: user_email
          schema:
            type: string
          description: User identifier.
          required: true
      requestBody:
        description: permissions payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserEditMeta'
      responses:
        '200':
          description: OK
        '403':
          description: you do not have privileges to access this resource
        '404':
          description: resource not found
  /raw/1/api/admin/permissions:
    get:
      tags:
        - permissions
      summary: Users with permissions.
      description: Returns the users along with the permissions.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PermissionMeta'
        '403':
          description: you do not have privileges to access this resource
    post:
      tags:
        - permissions
      summary: add permissions for users.
      description: an admin sets up users and permissions for his instance.
      requestBody:
        description: user and permissions payload
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RegistrationMeta'
      responses:
        '201':
          description: Created
        '400':
          description: Cannot register users due to illegal data
        '403':
          description: you do not have privileges to access this resource
  /raw/1/api/admin/permissions/invite:
    post:
      tags:
        - permissions
      summary: invites users and adds permissions.
      description: >-
        an admin sets up users and permissions for this instance. Also sends
        invitation emails.
      requestBody:
        description: user and permissions payload
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/InviteMeta'
      responses:
        '201':
          description: Created
        '400':
          description: Cannot register users due to illegal data
        '403':
          description: you do not have privileges to access this resource
  /raw/1/api/admin/permissions/activate/{user_email}:
    put:
      tags:
        - permissions
      summary: activate a registered user.
      description: a user has responded to an activation email.
      parameters:
        - in: path
          name: user_email
          schema:
            type: string
          description: User email identifier.
          required: true
      responses:
        '200':
          description: OK
        '403':
          description: you do not have privileges to access this resource
        '404':
          description: resource not found
  /raw/1/api/admin/users/{user_email}:
    delete:
      tags:
        - permissions
      summary: Deletes a user.
      description: Delete the user along with all the permissions he/she owns.
      parameters:
        - in: path
          name: user_email
          schema:
            type: string
          description: User identifier.
          required: true
      responses:
        '200':
          description: OK
        '403':
          description: you do not have privileges to access this resource
        '404':
          description: resource not found
  /raw/1/api/admin/api-keys:
    get:
      tags:
        - api-keys
      summary: API keys
      description: Returns the list of defined api keys and metadata
      operationId: getApiKeys
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIKeyMeta'
        '403':
          description: you do not have privileges to access this resource
    post:
      tags:
        - api-keys
      summary: generate a new API key with the required properties
      operationId: addApiKey
      requestBody:
        description: API Key properties
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyBase'
      responses:
        '201':
          description: Created
        '400':
          description: Cannot register users due to illegal data
        '403':
          description: you do not have privileges to access this resource
  /raw/1/api/admin/api-keys/{key_id}/{activate}:
    put:
      tags:
        - api-keys
      summary: activate/deactivate an API key
      operationId: activateApiKey
      parameters:
        - in: path
          name: key_id
          schema:
            type: string
          description: API Key identifier.
          required: true
        - in: path
          name: activate
          schema:
            type: boolean
          description: activate/deactivate API key
          required: true
      responses:
        '201':
          description: Created
        '403':
          description: you do not have privileges to access this resource
        '404':
          description: resource not found
  /raw/1/api/admin/api-keys/{key_id}:
    delete:
      tags:
        - api-keys
      summary: delete API key
      operationId: deleteApiKey
      parameters:
        - in: path
          name: key_id
          schema:
            type: string
          description: API Key identifier.
          required: true
      responses:
        '204':
          description: Deleted
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/scopes:
    get:
      tags:
        - scopes
      summary: List scopes
      description: Returns the list of defined scopes
      operationId: getScopes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScopeMeta'
        '403':
          description: you do not have privileges to access this resource
  /raw/1/api/admin/installations:
    get:
      tags:
        - installations
      summary: Installations of current instance.
      description: Returns the installations of the current instance.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InstallationMetadata'
  /raw/1/api/admin/installation/{id}:
    post:
      tags:
        - installations
      summary: New installation.
      description: Registers a new installation.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: Github Installation Identifier.
          required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BaseRepository'
        '400':
          description: Cannot register new installation due to illegal data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos:
    get:
      tags:
        - repository
      summary: Available repositories.
      description: Returns list of available repositories accessible by the user.
      parameters:
        - in: query
          name: url
          schema:
            type: string
          description: Search by Repository URL.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RepositoryWithLatestCommit'
  /raw/1/api/admin/repos/{repo_id}:
    get:
      tags:
        - repository
      summary: Repository branches.
      description: Returns branches of a repository.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Repository'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/security:
    get:
      tags:
        - repository
      summary: Repository security.
      description: Returns security rules of a repository.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RepositorySecurity'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    post:
      tags:
        - repository
      summary: New repository security setting.
      description: >-
        Create new security setting, aka user/role definition on this
        repository.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      requestBody:
        description: security setting definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepositorySecurity'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositorySecurity'
        '400':
          description: Cannot create new repository security setting due to illegal data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/security/{user_id}:
    get:
      tags:
        - repository
      summary: Repository security setting of the given repository for the given user.
      description: Get the security setting of the given repository for the given user.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          description: User identified.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositorySecurity'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    put:
      tags:
        - repository
      summary: Repository security setting of the given repository for the given user.
      description: Update the security setting of the given repository for the given user.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          description: User identified.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepositorySecurity'
      responses:
        '201':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositorySecurity'
        '400':
          description: >-
            Cannot update existing repository security setting due to illegal
            data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    delete:
      tags:
        - repository
      summary: Repository security setting of the given repository for the given user.
      description: Delete the security setting of the given repository for the given user.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          description: User identified.
          required: true
      responses:
        '204':
          description: Deleted
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/zoho_verification_url:
    post:
      tags:
        - repository
      summary: Zoho credential initiation request.
      description: Makes request to get verification url for zoho.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      requestBody:
        description: credentials definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HttpOAuth2ClientCredential'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                items:
                  $ref: '#/components/schemas/ZohoVerificationUrl'
        '400':
          description: Cannot create new repository credentials due to illegal data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/credentials:
    get:
      tags:
        - repository
      summary: Repository credentials.
      description: Get all credentials of the given repository.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RepositoryCredential'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    post:
      tags:
        - repository
      summary: New repository credentials.
      description: Create new repository credentials
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
      requestBody:
        description: credentials definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepositoryCredential'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryCredential'
        '400':
          description: Cannot create new repository credentials due to illegal data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/credentials/{cred_id}:
    get:
      tags:
        - repository
      summary: Repository credentials with the given name.
      description: Get repository credentials with the given name.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: cred_id
          schema:
            type: string
          description: Credentials identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryCredential'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    put:
      tags:
        - repository
      summary: Repository credentials with the given name.
      description: Update repository credentials with the given name.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
            format: base64
          description: Repository identifier.
          required: true
        - in: path
          name: cred_id
          schema:
            type: string
          description: Credentials identifier.
          required: true
      requestBody:
        description: user role definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepositoryCredential'
      responses:
        '201':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryCredential'
        '400':
          description: >-
            Cannot update existing new repository credentials due to illegal
            data
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    delete:
      tags:
        - repository
      summary: Repository credentials with the given name.
      description: Delete repository credentials with the given name.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: cred_id
          schema:
            type: string
          description: Credentials identifier.
          required: true
      responses:
        '204':
          description: Deleted
        '403':
          description: User is not authorized to access this repository
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/{repo_id}/credentials/{cred_id}/access:
    get:
      tags:
        - repository
      summary: Repository credentials access.
      description: Check repository credentials access.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: path
          name: cred_id
          schema:
            type: string
          description: Credentials identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialAccess'
        '401':
          description: Source exists but use is unauthorized to access it
        '404':
          description: Requested data not found
  /raw/1/api/admin/repo_events/{repo_id}:
    get:
      tags:
        - repository events
      operationId: getRepositoryEvents
      summary: Repository events.
      description: >-
        Returns events that occured during a repository import or refresh
        process.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: The number of events to skip before starting to collect the results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of events to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedRepositoryEventDescription'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repo_events/{repo_id}/{branch}/{repo_event_id}:
    get:
      tags:
        - repository events
      operationId: getRepositoryEvent
      summary: Repository event details.
      description: Returns event details of the requested event.
      parameters:
        - in: path
          name: repo_id
          schema:
            type: string
          description: Repository event identifier.
          required: true
        - in: path
          name: branch
          schema:
            type: string
          description: Branch for which we are concerned
          required: true
        - in: path
          name: repo_event_id
          schema:
            type: string
          description: Repository event identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedRepositoryEventDescription'
        '400':
          description: client request error
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repo_events/{repo_event_id}/messages:
    get:
      tags:
        - repository events
      operationId: getRepositoryEventMessages
      summary: Repository event detailed messages.
      description: >-
        Returns detailed messages regarding an event during a repository import
        or refresh process.
      parameters:
        - in: path
          name: repo_event_id
          schema:
            type: string
          description: Repository event identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: >-
            The number of details to skip before starting to collect the
            results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of details to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedRepositoryMessages'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/branch_events/{repo_event_id}/branches:
    get:
      tags:
        - repository events
      operationId: getBranchEvents
      summary: Repository branch events.
      description: Returns branch events for the inquired repository event id.
      parameters:
        - in: path
          name: repo_event_id
          schema:
            type: string
          description: Repository event identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: The number of events to skip before starting to collect the results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of events to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedBranchEventDescription'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/branch_events/{branch_event_id}/messages:
    get:
      tags:
        - repository events
      operationId: getBranchMessages
      summary: Repository branch event messages.
      description: Returns branch messages for the inquired branch event id.
      parameters:
        - in: path
          name: branch_event_id
          schema:
            type: string
          description: Branch event identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: >-
            The number of messages to skip before starting to collect the
            results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of messages to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedBranchMessages'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/branch_events/branches/{branch_event_id}/file_events:
    get:
      tags:
        - repository events
      operationId: getFileEvents
      summary: Repository branch file events.
      description: Returns branch file events for the inquired branch event id.
      parameters:
        - in: path
          name: branch_event_id
          schema:
            type: string
          description: Branch event identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: >-
            The number of messages to skip before starting to collect the
            results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of messages to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedFileEventDescription'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/file_events/yaml/{event_id}:
    get:
      tags:
        - repository events
      operationId: getYamlEvent
      summary: Repository branch yaml event.
      description: Returns the yaml event represented by the inquired yaml event id.
      parameters:
        - in: path
          name: event_id
          schema:
            type: string
          description: Yaml event identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YamlEvent'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/file_events/rql/{event_id}:
    get:
      tags:
        - repository events
      operationId: getRqlEvent
      summary: Repository branch rql event.
      description: Returns the rql event represented by the inquired rql event id.
      parameters:
        - in: path
          name: event_id
          schema:
            type: string
          description: Rql event identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RqlEvent'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/repos/tasks:
    get:
      tags:
        - repository
      summary: Repository refresh tasks status.
      description: Returns status regarding repository refresh tasks.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryRefreshTask'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/endpoints:
    get:
      tags:
        - endpoint
      summary: Available endpoints.
      description: Returns list of available endpoints accessible by the user.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EndpointIdentifier'
  /raw/1/api/admin/endpoints/{endpoint_id}:
    get:
      tags:
        - endpoint
      summary: Endpoint description.
      description: Returns description of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: header
          name: Accept
          schema:
            type: string
          required: true
          description: defines if to show code or not
      responses:
        '200':
          description: OK
          content:
            application/vnd.endpoint-code+json:
              schema:
                $ref: '#/components/schemas/BaseEndpoint'
  /raw/1/api/admin/endpoints/{endpoint_id}/security:
    get:
      tags:
        - endpoint
      summary: Endpoint security.
      description: Returns security rules of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointSecurity'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
    put:
      tags:
        - endpoint
      summary: Endpoint security.
      description: Update security rules of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: query
          name: isPrivate
          schema:
            type: boolean
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointSecurity'
        '400':
          description: Bad request
  /raw/1/api/admin/endpoints/{endpoint_id}/deployment_settings:
    get:
      tags:
        - endpoint
      summary: Endpoint deployment settings.
      description: Returns deployment settings of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointDeploymentSettings'
  /raw/1/api/admin/endpoints/{endpoint_id}/credits:
    get:
      tags:
        - endpoint
      summary: Endpoint credits.
      description: Returns credits of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointCredits'
  /raw/1/api/admin/endpoint_events/{endpoint_id}:
    get:
      tags:
        - endpoint events
      summary: Endpoint events.
      description: Returns events of a given endpoint.
      operationId: getEndpointEvents
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: The number of events to skip before starting to collect the results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of events to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedEndpointEventDescription'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/endpoint_events/{endpoint_event_id}/messages:
    get:
      tags:
        - endpoint events
      summary: Endpoint event messages.
      description: Returns messages of a given endpoint event.
      operationId: getEndpointEventMessages
      parameters:
        - in: path
          name: endpoint_event_id
          schema:
            type: string
          description: Endpoint event identifier.
          required: true
        - in: query
          name: start
          schema:
            type: integer
          description: The number of events to skip before starting to collect the results.
          required: false
        - in: query
          name: limit
          schema:
            type: integer
          description: The numbers of events to return in total.
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedEndpointMessages'
        '400':
          description: pagination parameters out of range
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Requested data not found
  /raw/1/api/admin/endpoints/{endpoint_id}/openapi:
    get:
      tags:
        - endpoint
      summary: OpenAPI description.
      description: Returns OpenAPI description of an endpoint or an organization.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: query
          name: version
          schema:
            type: string
            default: 3.0.0
          description: OpenAPI version.
          required: false
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: <OpenAPI description>
  /raw/1/api/admin/local/endpoints/{endpoint_id}:
    delete:
      tags:
        - local endpoints
      operationId: deleteLocalEndpoint
      summary: Delete a local endpoint.
      description: Deletes a local endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Local Endpoint identifier.
          required: true
      responses:
        '202':
          description: Endpoint removed
        '400':
          description: Endpoint removal failed
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/draft/endpoints:
    get:
      tags:
        - draft endpoints
      summary: Available draft endpoints.
      operationId: listDraftEndpoints
      description: Returns list of available draft endpoints accessible by the user.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DraftEndpoint'
    post:
      tags:
        - draft endpoints
      operationId: createDraftEndpoint
      summary: Create a new draft endpoint.
      description: Creates a draft endpoint.
      requestBody:
        description: Local Endpoint definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocalEndpointDefinition'
      responses:
        '202':
          description: Draft Endpoint created. Returns the local endpoint identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftEndpoint'
        '400':
          description: Cannot create draft endpoint due to illegal data
        '403':
          description: User is not authorized to access this resource
    put:
      tags:
        - draft endpoints
      operationId: updateDraftEndpoint
      summary: Update a draft endpoint.
      description: Updates a draft endpoint.
      requestBody:
        description: Endpoint definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocalEndpointDefinition'
      responses:
        '202':
          description: Draft Endpoint updated. Returns the draft endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftEndpoint'
        '400':
          description: Cannot update endpoint due to illegal data
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/draft/endpoints/{id}/publish:
    post:
      tags:
        - draft endpoints
      operationId: publishDraftEndpoint
      summary: Schedules a draft endpoint for publishing.
      description: Schedules a draft endpoint for publishing.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: Draft Endpoint identifier.
          required: true
      responses:
        '202':
          description: Draft Endpoint scheduled. Returns the local endpoint identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftScheduledEndpointIdentifier'
        '400':
          description: Cannot create draft endpoint due to illegal data
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/draft/endpoints/{id}:
    get:
      tags:
        - draft endpoints
      summary: Get details of the specified draft endpoint.
      operationId: getDraftEndpointById
      description: Returns draft endpoint metadata for the specified ID.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: Draft Endpoint identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftEndpoint'
    delete:
      tags:
        - draft endpoints
      operationId: deleteDraftEndpoint
      summary: Delete a draft endpoint.
      description: Deletes a draft endpoint.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: Draft Endpoint identifier.
          required: true
      responses:
        '202':
          description: Draft Endpoint removed
        '400':
          description: Draft Endpoint removal failed
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/local/repository:
    get:
      tags:
        - local endpoints
      summary: >-
        Get the local repository of the organization, i.e. the repository that
        serves all local endpoints.
      operationId: getLocalRepository
      description: Returns the local repository of the organization.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseRepository'
  /raw/1/api/admin/test_code:
    post:
      tags:
        - execution
      summary: Execute test code.
      description: Execute test code and returns results/errors.
      requestBody:
        description: Program definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCode'
      responses:
        '202':
          description: >-
            Program accepted for execution. Returns the program id in the body
            of the response
          headers:
            Location:
              schema:
                type: string
              description: URL assigned to the program (for retrieving output and logs).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeId'
        '400':
          description: Program submission failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/test_code/{programId}/output:
    get:
      tags:
        - execution
      summary: Retrieves program output.
      description: Retrieves program output.
      parameters:
        - in: path
          name: programId
          schema:
            type: string
          description: Program ID.
          required: true
      responses:
        '200':
          description: Program executed successfully
          content:
            application/json:
              schema:
                type: object
            text/csv:
              schema:
                type: object
        '400':
          description: Program execution failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionError'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Program not found
  /raw/1/api/admin/test_code/{programId}/log:
    post:
      tags:
        - execution
      summary: Retrieves program logs.
      description: Retrieves program logs.
      parameters:
        - in: path
          name: programId
          schema:
            type: string
          description: Program ID.
          required: true
        - in: query
          name: level
          schema:
            $ref: '#/components/schemas/LogLevel'
          description: Log level to filter.
          required: false
        - in: query
          name: start
          schema:
            type: integer
            format: int32
            default: 0
          description: 'Index of first log to retrieve. Default: 0.'
          required: false
        - in: query
          name: limit
          schema:
            type: integer
            format: int32
            default: 100
          description: 'How many log entries to return. Default: 100.'
          required: false
      responses:
        '200':
          description: Program logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionLogResponse'
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Program not found
  /raw/1/api/admin/test_code/{programId}:
    delete:
      tags:
        - execution
      summary: Deletes program.
      description: Deletes program.
      parameters:
        - in: path
          name: programId
          schema:
            type: string
          description: Program ID.
          required: true
      responses:
        '204':
          description: Deleted
        '403':
          description: User is not authorized to access this resource
        '404':
          description: Program not found
  /raw/1/api/admin/test_code_validate:
    post:
      tags:
        - execution
      summary: Validate test code.
      description: Validate test code and returns the validation result.
      requestBody:
        description: Program definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCodeValidate'
      responses:
        '200':
          description: Validation OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramDescription'
        '400':
          description: Program validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/validate:
    post:
      tags:
        - lsp
      summary: Does an LSP code validation request.
      description: Sends the code to be validated, and returns a collection of errors
      requestBody:
        description: Code and needed parameters,
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspValidateCode'
      responses:
        '200':
          description: Validation OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramDescription'
        '400':
          description: Code formatting failed failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/format-code:
    post:
      tags:
        - lsp
      summary: Does an LSP formatting request.
      description: Sends the code to be formatted, and receives the formatted code.
      requestBody:
        description: Code and needed parameters,
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspFormatCode'
      responses:
        '200':
          description: Returns the formatted code
          headers:
            Location:
              schema:
                type: string
              description: The formatted code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LspFormattedCode'
        '400':
          description: Code formatting failed failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/autocomplete:
    post:
      tags:
        - lsp
      summary: Does the autocompletion LSP request.
      description: >-
        Given the code and the trigger type, it returns the list of possible
        autocompletion items.
      requestBody:
        description: Code and the triggering character,
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspAutocomplete'
      responses:
        '200':
          description: Returns a collection of suggested items
          headers:
            Location:
              schema:
                type: string
              description: A collection of items for autocompletion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LspAutocompletionItems'
        '400':
          description: Autocompletion failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/hover:
    post:
      tags:
        - lsp
      summary: Does the hover LSP request.
      description: Given a code position, returns its type or documentation description.
      requestBody:
        description: The position of the hover
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspRequestPosition'
      responses:
        '200':
          description: Returns a collection of suggested items
          headers:
            Location:
              schema:
                type: string
              description: A name - type pair
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LspHoverResult'
        '400':
          description: Autocompletion failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/definition:
    post:
      tags:
        - lsp
      summary: Does the go to definition LSP request.
      description: Given a code position, returns the position of its definition.
      requestBody:
        description: The position of token which definition is to be found
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspRequestPosition'
      responses:
        '200':
          description: Returns a collection of suggested items
          headers:
            Location:
              schema:
                type: string
              description: The position of the definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LspResponsePosition'
        '400':
          description: Autocompletion failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/admin/lsp/rename:
    post:
      tags:
        - lsp
      summary: Does the rename LSP request.
      description: >-
        Given the position of the token to be renamed returns the list of
        positions where this token is used.
      requestBody:
        description: A name - type pair
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LspRequestPosition'
      responses:
        '200':
          description: Returns a collection of suggested items
          headers:
            Location:
              schema:
                type: string
              description: The collection of the positions to be renamed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LspResponsePositions'
        '400':
          description: Rename failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCodeValidateError'
        '403':
          description: User is not authorized to access this resource
  /raw/1/api/public/endpoints:
    get:
      tags:
        - public endpoint
      summary: Available endpoints.
      description: >-
        Returns list of available of endpoints accessible by the user with
        publicly visible information.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EndpointIdentifier'
  /raw/1/api/public/endpoints/{endpoint_id}/openapi:
    get:
      tags:
        - public endpoint
      summary: OpenAPI description.
      description: Returns OpenAPI description of an endpoint or an organization.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: query
          name: version
          schema:
            type: string
            default: 3.0.0
          description: OpenAPI version.
          required: false
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: <OpenAPI description>
  /raw/1/api/public/endpoints/{endpoint_id}/invocation:
    get:
      tags:
        - public endpoint
      summary: Get client code.
      description: Returns client code used for calling the selected endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: query
          name: language
          schema:
            type: string
            enum:
              - curl
              - java
              - scala
              - python
            default: curl
          description: Language code, e.g. Java, Scala, Python, etc..
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocationCode'
        '403':
          description: User is not authorized to access this endpoint
        '404':
          description: Requested data not found
  /raw/1/api/public/endpoints/{endpoint_id}/excel-invocation:
    get:
      tags:
        - public endpoint
      summary: Get Excel file for invocation.
      description: Returns Excel file used for calling the selected endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
      responses:
        '200':
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '403':
          description: User is not authorized to access this endpoint
        '404':
          description: Requested data not found
  /raw/1/api/public/endpoints/{endpoint_id}:
    get:
      tags:
        - public endpoint
      summary: Endpoint description.
      description: Returns description of an endpoint.
      parameters:
        - in: path
          name: endpoint_id
          schema:
            type: string
          description: Endpoint identifier.
          required: true
        - in: header
          name: Accept
          schema:
            type: string
          required: true
          description: defines if to show code or not
      responses:
        '200':
          description: OK
          content:
            application/vnd.endpoint-code+json:
              schema:
                $ref: '#/components/schemas/BaseEndpoint'
        '403':
          description: User is not authorized to access this endpoint
        '404':
          description: Requested data not found
components:
  schemas:
    Path:
      type: string
      pattern: ^\/([a-z0-9\-._~%!$&'()*+,;=:@\/]*)
    BaseRepository:
      type: object
      properties:
        repoId:
          type: string
        url:
          type: string
    RepositoryWithLatestCommit:
      allOf:
        - $ref: '#/components/schemas/BaseRepository'
        - type: object
          properties:
            latestCommit:
              type: string
            updated:
              type: string
              format: date-time
    RepositoryBranch:
      type: object
      properties:
        branchName:
          type: string
        publishPath:
          $ref: '#/components/schemas/Path'
        enabled:
          type: boolean
    Repository:
      allOf:
        - $ref: '#/components/schemas/BaseRepository'
        - type: object
          properties:
            branches:
              type: array
              items:
                $ref: '#/components/schemas/RepositoryBranch'
          required:
            - branches
    RepositorySecurity:
      type: object
      properties:
        userId:
          type: string
        userName:
          type: string
        repoManager:
          type: boolean
        credentialsManager:
          type: boolean
        developer:
          type: boolean
      required:
        - userId
        - userName
        - repoManager
        - credentialsManager
        - developer
    ZohoVerificationUrl:
      type: object
      properties:
        user_code:
          type: string
        device_code:
          type: string
        verification_uri_complete:
          type: string
        expires_in:
          type: string
        interval:
          type: string
        verification_url:
          type: string
        error:
          type: string
      required:
        - user_code
        - device_code
        - verification_url
    RepositoryCredential:
      type: object
      discriminator:
        propertyName: repositoryType
        mapping:
          S3: '#/components/schemas/S3Credential'
          HDFS: '#/components/schemas/HDFSCredential'
          POSTGRESQL: '#/components/schemas/PostgreSQLCredential'
          MYSQL: '#/components/schemas/MySQLCredential'
          ORACLE: '#/components/schemas/OracleCredential'
          SQLSERVER: '#/components/schemas/SqlServerCredential'
          TERADATA: '#/components/schemas/TeradataCredential'
          SECRET: '#/components/schemas/SecretCredential'
          HTTP_OAUTH2_TOKEN: '#/components/schemas/HttpOAuth2TokenCredential'
          HTTP_OAUTH2_CLIENT: '#/components/schemas/HttpOAuth2ClientCredential'
          HTTP_BASIC_AUTH: '#/components/schemas/HttpBasicAuthCredential'
      properties:
        credId:
          type: string
        name:
          type: string
      required:
        - name
        - repositoryType
    S3Credential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            region:
              type: string
            access:
              type: object
              properties:
                accessKey:
                  type: string
                accessSecret:
                  type: string
          required:
            - region
    HDFSCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            token:
              type: string
          required:
            - token
    PostgreSQLCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            host:
              type: string
            port:
              type: string
            database:
              type: string
            username:
              type: string
            password:
              type: string
          required:
            - host
            - port
            - database
            - username
            - password
    MySQLCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            host:
              type: string
            port:
              type: string
            database:
              type: string
            username:
              type: string
            password:
              type: string
          required:
            - host
            - port
            - database
            - username
            - password
    OracleCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            host:
              type: string
            port:
              type: string
            database:
              type: string
            username:
              type: string
            password:
              type: string
          required:
            - host
            - port
            - database
            - username
            - password
    SqlServerCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            host:
              type: string
            port:
              type: string
            database:
              type: string
            username:
              type: string
            password:
              type: string
          required:
            - host
            - port
            - database
            - username
            - password
    TeradataCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            host:
              type: string
            port:
              type: string
            database:
              type: string
            username:
              type: string
            password:
              type: string
            parameters:
              type: array
              items:
                $ref: '#/components/schemas/Parameters'
          required:
            - host
            - port
            - database
            - username
            - password
    SecretCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            value:
              type: string
          required:
            - value
    HttpOAuth2TokenCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            provider:
              $ref: '#/components/schemas/OAuth2Provider'
            accessToken:
              type: string
            expiresBy:
              type: string
              format: date-time
            scopes:
              type: array
              items:
                type: string
            refreshToken:
              type: string
            options:
              type: object
              additionalProperties:
                type: string
          required:
            - provider
            - accessToken
    HttpOAuth2ClientCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            provider:
              $ref: '#/components/schemas/OAuth2Provider'
            clientId:
              type: string
            clientSecret:
              type: string
            options:
              type: object
              additionalProperties:
                type: string
          required:
            - provider
            - clientId
            - clientSecret
    HttpBasicAuthCredential:
      allOf:
        - $ref: '#/components/schemas/RepositoryCredential'
        - type: object
          properties:
            username:
              type: string
            password:
              type: string
            options:
              type: object
              additionalProperties:
                type: string
          required:
            - username
            - password
    CredentialAccess:
      oneOf:
        - $ref: '#/components/schemas/CredentialAccessTested'
        - $ref: '#/components/schemas/CredentialAccessUntested'
    CredentialAccessTested:
      type: object
      properties:
        credId:
          type: string
        access:
          type: boolean
    CredentialAccessUntested:
      type: object
      properties:
        credId:
          type: string
    Parameters:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
    RepositoryReference:
      oneOf:
        - $ref: '#/components/schemas/RepositoryReferenceById'
        - $ref: '#/components/schemas/RepositoryReferenceByUrl'
    RepositoryReferenceById:
      type: object
      properties:
        repoId:
          type: integer
          format: int64
    RepositoryReferenceByUrl:
      type: object
      properties:
        url:
          type: string
    EndpointIdentifier:
      type: object
      discriminator:
        propertyName: type
        mapping:
          GET: '#/components/schemas/GetEndpoint'
          POST: '#/components/schemas/PostEndpoint'
      properties:
        endpointId:
          type: string
        repositoryUrl:
          type: string
        path:
          $ref: '#/components/schemas/Path'
        branch:
          type: string
        title:
          type: string
        description:
          type: string
        locality:
          type: string
        security:
          $ref: '#/components/schemas/EndpointSecurity'
        tags:
          type: array
          items:
            type: string
    DraftScheduledEndpointIdentifier:
      type: object
      properties:
        endpointId:
          type: string
        draftEndpointId:
          type: string
        type:
          type: string
          default: GET
        path:
          $ref: '#/components/schemas/Path'
        title:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        commitHash:
          type: string
        repositoryId:
          type: string
        repositoryUrl:
          type: string
        branch:
          type: string
        locality:
          type: string
        createdAt:
          type: string
          format: date-time
        event:
          $ref: '#/components/schemas/RepositoryEventDescription'
    LocalEndpointDefinition:
      type: object
      properties:
        endpointId:
          type: string
        draftEndpointId:
          type: string
        exampleId:
          type: string
        type:
          type: string
          default: GET
        path:
          $ref: '#/components/schemas/Path'
        title:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        code:
          type: string
        declaration:
          type: string
        language:
          type: string
        termsOfService:
          type: string
        author:
          type: string
        version:
          type: string
        enabled:
          type: boolean
        deploymentSettings:
          $ref: '#/components/schemas/EndpointDeploymentSettings'
        security:
          $ref: '#/components/schemas/EndpointSecurity'
        contact:
          type: object
          $ref: '#/components/schemas/EndpointContact'
        license:
          type: object
          $ref: '#/components/schemas/EndpointLicense'
      required:
        - path
        - title
        - description
    DraftEndpoint:
      allOf:
        - $ref: '#/components/schemas/LocalEndpointDefinition'
        - type: object
          properties:
            commitHash:
              type: string
            repositoryId:
              type: string
            endpointId:
              type: string
            draftEndpointId:
              type: string
            branch:
              type: string
            repositoryUrl:
              type: string
            locality:
              type: string
            createdAt:
              type: string
              format: date-time
    BaseEndpoint:
      allOf:
        - $ref: '#/components/schemas/EndpointIdentifier'
        - type: object
          properties:
            title:
              type: string
            description:
              type: string
            tags:
              type: array
              items:
                type: string
            termsOfService:
              type: string
            author:
              type: string
            contact:
              type: object
              $ref: '#/components/schemas/EndpointContact'
            license:
              type: object
              $ref: '#/components/schemas/EndpointLicense'
            version:
              type: string
          required:
            - path
            - title
            - description
    GetEndpoint:
      allOf:
        - $ref: '#/components/schemas/BaseEndpoint'
        - type: object
          properties:
            code:
              type: string
            language:
              type: string
            outputType:
              type: string
            outputFormat:
              $ref: '#/components/schemas/MediaTypes'
            parameters:
              type: array
              items:
                $ref: '#/components/schemas/EndpointParameter'
          required:
            - outputType
            - outputFormat
    PostEndpoint:
      allOf:
        - $ref: '#/components/schemas/BaseEndpoint'
        - type: object
          properties:
            inputType:
              type: string
            inputFormat:
              type: string
              enum:
                - parquet
                - delta
                - postgresql
                - mysql
                - oracle
          required:
            - inputType
            - inputFormat
    EndpointParameter:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        defaultValue:
          type: string
    EndpointSecurity:
      type: object
      properties:
        visibility:
          type: boolean
        scopes:
          type: array
          items:
            type: string
      required:
        - visibility
        - scopes
    EndpointDeploymentSettings:
      type: object
      properties:
        computeClass:
          type: string
        computeCacheSizeMb:
          type: integer
          format: int64
        computeLimitSeconds:
          type: integer
          format: int32
        expireSeconds:
          type: integer
          format: int32
        format:
          type: string
      required:
        - computeClass
        - computeCacheSizeMb
        - computeLimitSeconds
        - expireSeconds
        - format
    EndpointCredits:
      type: object
      properties:
        credits-1h:
          type: integer
          format: int32
        credits-24h:
          type: integer
          format: int32
        creditsBillingPeriod:
          type: integer
          format: int32
      required:
        - credits-1h
        - credits-24h
        - creditsBillingPeriod
    RepositoryRefreshTask:
      type: object
      properties:
        taskCount:
          type: integer
        active:
          type: boolean
        processing:
          type: array
          description: Repository IDs that are under scrutiny at the moment of question.
          items:
            type: integer
            format: int64
    InstallationMetadata:
      type: object
      properties:
        id:
          type: string
        account:
          type: string
        target:
          type: string
        active:
          type: boolean
    InviteMeta:
      allOf:
        - $ref: '#/components/schemas/UserEditMeta'
        - type: object
          properties:
            account:
              type: string
          required:
            - account
            - producerRoles
            - consumerScopes
    UserEditMeta:
      type: object
      properties:
        producerRoles:
          type: string
        consumerScopes:
          type: string
    ScopeMeta:
      type: object
      description: >-
        represents an endpoint scope, used for authorization purposes on
        endpoint execution
      properties:
        id:
          type: string
        value:
          type: string
        count:
          type: integer
          description: number of endpoints referencing this scope
          format: int32
      required:
        - scope
        - count
    APIKeyBase:
      type: object
      properties:
        expires_at:
          type: string
          format: date-time
        name:
          type: string
        active:
          type: boolean
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/ScopeMeta'
      required:
        - name
        - active
        - expires_at
    APIKeyMeta:
      allOf:
        - type: object
          properties:
            id:
              type: string
            key:
              type: string
              description: key representation
            created_at:
              type: string
              format: date-time
        - $ref: '#/components/schemas/APIKeyBase'
          required:
            - id
            - name
            - scopes
            - active
            - key
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        key:
          type: string
          description: some representation of the key
        active:
          type: boolean
    RegistrationMeta:
      allOf:
        - $ref: '#/components/schemas/InviteMeta'
        - type: object
          properties:
            active:
              type: boolean
            verifyAuth:
              type: boolean
          required:
            - account
            - scopes
            - active
            - verifyAuth
    PermissionMeta:
      allOf:
        - $ref: '#/components/schemas/InviteMeta'
        - type: object
          properties:
            active:
              type: boolean
          required:
            - account
            - scopes
            - active
    TestCode:
      type: object
      properties:
        repositoryReference:
          $ref: '#/components/schemas/RepositoryReference'
        language:
          type: string
        code:
          type: string
        declaration:
          type: string
        arguments:
          type: object
          additionalProperties:
            type: string
        computeClass:
          type: string
        computeLimitSeconds:
          type: integer
          format: int32
          minimum: 1
        outputFormat:
          $ref: '#/components/schemas/MediaTypes'
      required:
        - repositoryReference
        - language
        - code
        - computeClass
        - outputFormat
    TestCodeValidate:
      type: object
      properties:
        repositoryReference:
          $ref: '#/components/schemas/RepositoryReference'
        language:
          type: string
        code:
          type: string
      required:
        - repositoryReference
        - language
        - code
    ProgramDescription:
      type: object
      properties:
        declarations:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ProgramDeclaration'
        tipe:
          type: string
        comment:
          type: string
      required:
        - declarations
    ProgramDeclaration:
      type: object
      properties:
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/DeclarationParameter'
        outputType:
          type: string
        comment:
          type: string
      required:
        - parameters
        - outputType
    DeclarationParameter:
      type: object
      properties:
        identifier:
          type: string
        tipe:
          type: string
        required:
          type: boolean
      required:
        - identifier
        - tipe
        - required
    TestCodeValidateError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        validationErrors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    TestCodeId:
      type: object
      properties:
        id:
          type: string
    MediaTypes:
      type: string
      enum:
        - csv
        - json
        - hjson
        - xml
        - text
        - binary
    ExecutionError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        runtimeError:
          type: string
        validationErrors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      required:
        - code
        - message
    ValidationError:
      type: object
      properties:
        message:
          type: string
        positions:
          type: array
          items:
            $ref: '#/components/schemas/Range'
      required:
        - message
    Range:
      type: object
      properties:
        begin:
          $ref: '#/components/schemas/Position'
        end:
          $ref: '#/components/schemas/Position'
      required:
        - begin
        - end
    Position:
      type: object
      properties:
        line:
          type: integer
          format: int32
        column:
          type: integer
          format: int32
      required:
        - line
        - column
    ExecutionLogResponse:
      type: object
      properties:
        start:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        logs:
          type: array
          items:
            $ref: '#/components/schemas/ExecutionLog'
      required:
        - start
        - size
        - logs
    ExecutionLog:
      type: object
      properties:
        level:
          $ref: '#/components/schemas/LogLevel'
        message:
          type: string
      required:
        - level
        - message
    LogLevel:
      type: string
      enum:
        - trace
        - debug
        - info
        - warn
        - error
    InvocationCode:
      type: object
      properties:
        language:
          type: string
          enum:
            - curl
            - java
            - scala
            - python
        code:
          type: string
      required:
        - language
        - code
    LspRequestProperties:
      type: object
      properties:
        repositoryReference:
          $ref: '#/components/schemas/RepositoryReference'
        language:
          type: string
        code:
          type: string
        options:
          type: object
          additionalProperties:
            type: string
      required:
        - language
        - code
    LspFormatCode:
      type: object
      properties:
        lspRequestProperties:
          $ref: '#/components/schemas/LspRequestProperties'
        numberOfSpaces:
          type: integer
        useTabs:
          type: boolean
      required:
        - numberOfSpaces
        - useTabs
        - lspRequestProperties
    LspValidateCode:
      type: object
      properties:
        lspRequestProperties:
          $ref: '#/components/schemas/LspRequestProperties'
      required:
        - lspRequestProperties
    LspAutocomplete:
      type: object
      properties:
        lspRequestProperties:
          $ref: '#/components/schemas/LspRequestProperties'
        triggeringChar:
          type: string
        position:
          $ref: '#/components/schemas/Position'
      required:
        - position
        - language
        - code
    LspRequestPosition:
      type: object
      properties:
        lspRequestProperties:
          $ref: '#/components/schemas/LspRequestProperties'
        position:
          $ref: '#/components/schemas/Position'
      required:
        - position
        - lspRequestProperties
    LspResponsePosition:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
        position:
          $ref: '#/components/schemas/Position'
      required:
        - position
        - lspRequestProperties
    LspResponsePositions:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
        positions:
          type: array
          items:
            $ref: '#/components/schemas/Position'
      required:
        - positions
        - errors
    LspHoverResult:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
        lspTooltip:
          $ref: '#/components/schemas/LspTooltip'
      required:
        - errors
        - lspTooltip
    LspTooltip:
      oneOf:
        - $ref: '#/components/schemas/LspDocsPackageResult'
        - $ref: '#/components/schemas/LspDocsEntryResult'
        - $ref: '#/components/schemas/LspTypeResult'
    LspDocsPackageResult:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        info:
          type: string
        warning:
          type: string
        danger:
          type: string
      required:
        - name
    LspDocsEntryResult:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        summary:
          type: string
        example:
          type: string
        syntax:
          type: string
        params:
          type: array
          items:
            $ref: '#/components/schemas/LspEntryParams'
        info:
          type: string
        warning:
          type: string
        danger:
          type: string
      required:
        - name
    LspEntryParams:
      type: object
      properties:
        name:
          type: string
        tipes:
          type: array
          items:
            type: string
        description:
          type: string
        isOptional:
          type: boolean
        isVarArg:
          type: boolean
        info:
          type: string
        warning:
          type: string
        danger:
          type: string
      required:
        - name
    LspTypeResult:
      type: object
      properties:
        name:
          type: string
        tipe:
          type: string
      required:
        - tipe
        - name
    LspFormattedCode:
      type: object
      properties:
        formattedCode:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      required:
        - formattedCode
        - errors
    LspAutocompletionItems:
      type: object
      properties:
        autocompletionItems:
          type: array
          items:
            $ref: '#/components/schemas/LspAutocompletionItem'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      required:
        - autocompletionItems
        - errors
    LspAutocompletionItem:
      type: object
      properties:
        name:
          type: string
        autoCompleteType:
          type: integer
        lspTooltip:
          $ref: '#/components/schemas/LspTooltip'
      required:
        - name
        - lspTooltip
    State:
      type: string
      description: Current state of the event.
      enum:
        - PENDING
        - SUCCESS
        - FAILED
        - PARTIAL_SUCCESS
    Level:
      type: string
      description: Level of the message.
      enum:
        - INFO
        - WARNING
        - ERROR
    PageMetadata:
      type: object
      properties:
        total:
          type: integer
          format: int32
          description: Total number of entries found in the response.
        from:
          type: integer
          format: int32
          description: The start index of the response.
        to:
          type: integer
          format: int32
          description: The end index of the response.
    EventMetadata:
      type: object
      properties:
        state:
          $ref: '#/components/schemas/State'
        timestamp:
          type: string
          format: date-time
    EventMessage:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        level:
          $ref: '#/components/schemas/Level'
        message:
          type: string
    YamlMessage:
      allOf:
        - $ref: '#/components/schemas/EventMessage'
        - type: object
          properties:
            positions:
              type: array
              items:
                $ref: '#/components/schemas/Range'
    RqlMessage:
      allOf:
        - $ref: '#/components/schemas/EventMessage'
        - type: object
          properties:
            positions:
              type: array
              items:
                $ref: '#/components/schemas/Range'
    YamlEvent:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/YamlMessage'
    RqlEvent:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/RqlMessage'
    RepositoryEventDescription:
      allOf:
        - $ref: '#/components/schemas/EventMetadata'
        - type: object
        - properties:
            eventId:
              type: integer
              format: int64
            eventType:
              $ref: '#/components/schemas/EventType'
          required:
            - state
            - timestamp
            - eventType
            - eventId
    PagedRepositoryEventDescription:
      allOf:
        - properties:
            events:
              type: array
              items:
                $ref: '#/components/schemas/RepositoryEventDescription'
            page:
              $ref: '#/components/schemas/PageMetadata'
    DetailedRepositoryEventDescription:
      allOf:
        - $ref: '#/components/schemas/RepositoryEventDescription'
        - properties:
            errors:
              type: array
              items:
                type: string
    PagedRepositoryMessages:
      allOf:
        - properties:
            messages:
              type: array
              minItems: 1
              maxItems: 100
              items:
                $ref: '#/components/schemas/EventMessage'
            page:
              $ref: '#/components/schemas/PageMetadata'
    PagedBranchMessages:
      allOf:
        - properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/EventMessage'
            page:
              $ref: '#/components/schemas/PageMetadata'
    PagedBranchEventDescription:
      allOf:
        - properties:
            events:
              type: array
              items:
                $ref: '#/components/schemas/BranchEventDescription'
            page:
              $ref: '#/components/schemas/PageMetadata'
    BranchEventDescription:
      allOf:
        - $ref: '#/components/schemas/EventMetadata'
        - type: object
          properties:
            branchName:
              type: string
            eventId:
              type: integer
              format: int64
            commitHash:
              type: string
            commitTimestamp:
              type: string
              format: date-time
          required:
            - branchName
            - eventId
            - state
            - timestamp
    PagedFileEventDescription:
      allOf:
        - properties:
            events:
              type: array
              items:
                $ref: '#/components/schemas/FileEventDescription'
            page:
              $ref: '#/components/schemas/PageMetadata'
    FileEventDescription:
      type: object
      discriminator:
        propertyName: fileType
        mapping:
          RQL: '#/components/schemas/RqlEventDescription'
          YML: '#/components/schemas/YamlEventDescription'
      allOf:
        - $ref: '#/components/schemas/EventMetadata'
      properties:
        state:
          $ref: '#/components/schemas/State'
        timestamp:
          type: string
          format: date-time
        path:
          type: string
        eventId:
          type: integer
          format: int64
      required:
        - state
        - timestamp
        - path
        - eventId
    YamlEventDescription:
      allOf:
        - $ref: '#/components/schemas/FileEventDescription'
        - type: object
          required:
            - path
            - eventId
            - state
            - timestamp
    RqlEventDescription:
      allOf:
        - $ref: '#/components/schemas/FileEventDescription'
        - type: object
          required:
            - path
            - eventId
            - state
            - timestamp
    EndpointExecutionStats:
      type: object
      properties:
        executionTime:
          type: integer
          format: int64
          description: Duration of execution in seconds.
        creditsConsumed:
          type: integer
          format: int32
          description: Total credits consumed for that execution.
        outputSize:
          type: integer
          format: int32
          description: Output size of the query in MB.
        cached:
          type: boolean
          description: True if the query was a cache hit.
    EndpointEventDescription:
      allOf:
        - $ref: '#/components/schemas/EventMetadata'
        - properties:
            eventId:
              type: integer
              format: int64
            stats:
              $ref: '#/components/schemas/EndpointExecutionStats'
            settings:
              $ref: '#/components/schemas/EndpointDeploymentSettings'
            parameters:
              type: array
              items:
                $ref: '#/components/schemas/Parameters'
          required:
            - eventId
            - state
            - timestamp
            - settings
            - creditsConsumed
            - outputSize
            - parameters
    PagedEndpointEventDescription:
      allOf:
        - properties:
            events:
              type: array
              items:
                $ref: '#/components/schemas/EndpointEventDescription'
            page:
              $ref: '#/components/schemas/PageMetadata'
    EventType:
      type: string
      enum:
        - REFRESH_REPOSITORY
        - REFRESH_BRANCH_FROM_LATEST
        - REFRESH_BRANCH_FROM_COMMIT
        - REFRESH_BRANCH_FROM_LOCAL_COMMIT
      description: |
        eventType:
          * `REFRESH_REPOSITORY` - Corresponds to RefreshRepositoryEvent
          * `REFRESH_BRANCH_FROM_LATEST` - Corresponds to RefreshBranchFromLatestEvent
          * `REFRESH_BRANCH_FROM_COMMIT` - Corresponds to RefreshBranchFromCommitEvent
          * `REFRESH_BRANCH_FROM_LOCAL_COMMIT` - Corresponds to RefreshBranchFromLocalCommitEvent
    PagedEndpointMessages:
      allOf:
        - properties:
            messages:
              type: array
              minItems: 1
              maxItems: 100
              items:
                $ref: '#/components/schemas/EventMessage'
            page:
              $ref: '#/components/schemas/PageMetadata'
    OAuth2Token:
      allOf:
        - properties:
            provider:
              $ref: '#/components/schemas/OAuth2Provider'
            accessToken:
              type: string
            expiresBy:
              type: string
              format: date-time
            scopes:
              type: array
              items:
                type: string
            refreshToken:
              type: string
          required:
            - accessToken
            - expiresBy
            - scopes
    OAuth2Provider:
      type: string
      enum:
        - dropbox
        - auth0
        - shopify
        - twitter
        - zoho
        - linkedin
        - generic
        - google-api
    EndpointContact:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          format: email
        url:
          type: string
          format: url
      required:
        - name
    EndpointLicense:
      type: object
      properties:
        name:
          type: string
        url:
          type: string
          format: url
      required:
        - name
