openapi: 3.0.0
servers:
  - url: '/v2'
    description: Provider API v2
  - url: '/'
    description: Reserved
info:
  description: |
    Lionbridge Provider API specification. This is intended for language service provider connector integration within [Content API v2](https://developers.lionbridge.com/content/v2/docs/index.html).


    A provider connector should implement the following:
      - creating providers and optionally specify capabilities
      - listen for job submissions, either by listeners or periodically querying
      - perform translation on AssetTasks
      - update statuses of AssetTasks, including intermediate states and errors, to notify submitter

    Note: Methods and resources marked as ***Preview Feature*** are subject to future changes that may not be backwards compatible.

  version: 2.0.20241030.1
  title: The Lionbridge Provider API v2
  contact:
    email: ken.che@lionbridge.com
tags:
  - name: Provider
    description: A translation provider provides translation services.  It is an entity that Content API users can submit jobs to, for contents to be translated or processed.
  - name: FileTransfer
    description: |
      An object containing information for transferring source or
      translated (target) files between the Connector and the translation provider, using
      the Lionbridge File Management Service (FMS). For more
        information, please visit [https://developers.lionbridge.com/content/v2/docs/file_transfer.html](https://developers.lionbridge.com/content/v2/docs/file_transfer.html)

  - name: Job
    description: A job is a container of translation asset tasks that is sent as a single unit to the translation provider.
  - name: AssetTask
    description: Asset tasks are translation tasks for source files.
  - name: SupportAsset
    description: Reference material for aiding translation.
  - name: Listener
    description: |
      ***Preview Feature***
      Webhook for notifying provider about jobs and asset tasks changes.
  - name: TranslationMemory
    description: Updates for previously translated material stored on the provider.
  - name: ProviderType
    description: ProviderType is addtional configuration for a provider


# 2) Apply the security globally to all operations
security:
  - bearerAuth: []

paths:
  /providers:
    get:
      tags:
        - Provider
      summary: 'List Providers, optionally filter by organization'
      operationId: GetProviders
      parameters:
        - name: siteId
          in: query
          description: Org ID that needs to be considered for filter.
          schema:
            type: string
        - name: pageSize
          in: query
          description: PageSize - number of providers returned for each page.
          schema:
            type: string
        - $ref: '#/components/parameters/navNextParam'
        - name: includeAdvanceProviderInfo
          in: query
          description: The default value is false, list Providers without provider type information.
          schema:
            type: boolean
            default: false
        - name: includeDeletedOnes
          in: query
          description: The default value is false, list Providers without deleted ones
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderArray'
          links:
            GetNext:
              operationId: GetProviders
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      tags:
        - Provider
      summary: Add a new provider
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        $ref: '#/components/requestBodies/CreateProvider'

  /providerInfos:
    get:
      tags:
        - ProviderInfo
      summary: 'List Provider Infos'
      operationId: GetProviderInfos
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderInfoArray'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  '/providers/{providerId}':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
    get:
      tags:
        - Provider
      summary: Find provider by ID
      description: Returns a single provider
      parameters:
        - name: includeAdvanceProviderInfo
          in: query
          description: The default value is false, get Provider without provider type information.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      tags:
        - Provider
      summary: Updates a provider's capabilities
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        $ref: '#/components/requestBodies/UpdateProvider'

    put:
      tags:
        - Provider
      summary: Updates a provider's capabilities
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        $ref: '#/components/requestBodies/UpdateProvider'


    delete:
      tags:
        - Provider
      summary: Deletes a provider softly instead of removing it from db
      description: modify the provider's field `isDeleted` to true to represent it's deleted, also the related Listener&Webhook do.
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


  '/providers/{providerId}/jobs/{jobId}/supportAssets/{supportAssetId}/sourceFile':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
      - $ref: '#/components/parameters/jobIdParam'
      - $ref: '#/components/parameters/supportAssetIdParam'
    get:
      tags:
        - FileTransfer
      summary: Gets the support asset binary
      responses:
        '200':
          description: Placeholder response code for client codegen.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: Redirect
          headers:
            Location:
              schema:
                type: string
              description: URL to follow.


  '/providers/{providerId}/jobs/{jobId}/assetTasks/{assetTaskId}/sourceFile':
    get:
      tags:
        - FileTransfer
      summary: Gets the source file binary
      description: 'Gets the source file binary. The method returns a 307 response code. Clients are expected to follow the url in the Location header.  Most HTTP client libraries do this automatically or can be enabled by a configuration setting. For example, cURL has a -L option.'
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/assetTaskIdParam'

      responses:
        '200':
          description: Placeholder response code for client codegen.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: Redirect
          headers:
            Location:
              schema:
                type: string
              description: URL to follow.

  '/providers/{providerId}/jobs/{jobId}/assetTasks/{assetTaskId}/translatedFile':
    post:
      tags:
        - FileTransfer
      summary: Prepare to upload translated file binary
      description: |
        Prepare to upload translated file.  This method is part of a 2-step process for transferring file to Lionbridge FMS, either using the TUS protocol or POSTing directly as multipart/form-data.
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/assetTaskIdParam'
      responses:
        '201':
          description: Translated content file upload allocated.
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FMSTransferObject'
    get:
      tags:
        - FileTransfer
      summary: Download the translated file uploaded by the provider.
      description: 'Download the translated file uploaded by the provider'
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/assetTaskIdParam'
      responses:
        '200':
          description: Placeholder response code for client codegen.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: Redirect
          headers:
            Location:
              schema:
                type: string
              description: URL to follow.

  '/providers/{providerId}/jobs/{jobId}/zip':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
      - $ref: '#/components/parameters/jobIdParam'
    get:
      tags:
        - Diagnostic
      summary: Gets all files as a zip for a specific job.
      description: 'The method returns a 307 response code. Clients are expected to follow the url in the Location header. The zip file is named after jobId and it contains existed files from source and target folders for each language'
      responses:
        '200':
          description: Placeholder response code for client codegen.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: Redirect
          headers:
            Location:
              schema:
                type: string
              description: URL to follow.

  /listeners:
    get:
      tags:
        - Listener
      summary: Gets list of listeners (Preview Feature)
      operationId: GetListeners
      parameters:
        - $ref: '#/components/parameters/navNextParam'
        - name: includeDeletedOnes
          in: query
          description: The default value is false, list Listeners without deleted ones
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListenerArray'
          links:
            GetNext:
              operationId: GetListeners
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.


    post:
      tags:
        - Listener
      summary: Adds a global listener. (Preview Feature)
      description: |
        Adds a a global listener.  Only one global listener is permitted. If a provider-specific listener exists, the global listener will not be used for updates related to the provider.  For more information, please see the callback definitions for details.

        The user-specified endpoint is expected to return 200 on success.  If the callback delivery fails, the API retries
        for up to 24 hours with an exponential backoff.

        If callback retries exceed 24 hours and still cannot get successful response, callback retry will be stopped, and the listener will be marked as permanent probation. Under permanent probation, no further callbacks will be generated.
        User can PATCH the existing listener with repaired endpoint address to reset the listener.

        The recommended approach for integration is to always accept the callback upon receipt. A typical approach would be to:
            1. Accept the payload and immediately return HTTP 200 OK.
            2. Perform business logic as necessary,
            3. Or discard the event.

            The endpoint may receive many requests depending on activities on the API. Consider separating the event ingestion in Step 1 and asynchronosly perform business logic in Step 2.

        Due to the nature of webhook delivery, events are not guaranteed to be in order.
        For example, a job was first set to COMPLETE status and subsequently archived.
        Suppose the endpoint was not available when the COMPLETE webhook was sent, but recovered when the job was archived.
        The archived webhook would arrived first, then later the COMPLETE webhook on the next retry.
        Ensure the integration can handle out-of-order events gracefully.

      requestBody:
        $ref: '#/components/requestBodies/CreateListener'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listener'
        '409':
          description: Listener already exists
      callbacks:
        onJobStatusUpdate:
          '{$request.query.jobUrl}':
            put:
              description: |
                For jobs, the following conditions trigger event callbacks,
                - when status code matches codes defined on the listener
                - when job is archived, unarchived or deleted
                - when error flag changes
              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/JobStatusUpdateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onAssetTaskStatusUpdate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                For asset tasks, the following conditions trigger event callbacks,
                - when status code matches codes defined on the listener
                - when error flag changes
              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/AssetTaskStatusUpdatesBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onSupportAssetCreate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                (Preview Feature) For support assets, the following conditions trigger event callbacks,
                - when support asset is created

              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/SupportAssetCreateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onTmUpdateCreate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                (Preview Feature) For tmupdates, the following conditions trigger event callbacks,
                - when tmupdate is created

              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/TMUpdateCreateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback


  '/providers/{providerId}/listeners':
    post:
      tags:
        - Listener
      summary: Adds a provider-specific listener. (Preview Feature)
      description: |
        Creates a listener for job or asset task event callbacks.  User can specify the status(es) for triggering callbacks, and the URI for receiving HTTP requests from the API.  Only one provider-specific listener per provider is allowed.  For more information, please see the callback definitions for details.

        The user-specified endpoint is expected to return 200 on success.  If the callback delivery fails, the API retries
        for up to 24 hours with an exponential backoff.

      parameters:
        - $ref: '#/components/parameters/providerIdParam'
      requestBody:
        $ref: '#/components/requestBodies/CreateListener'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listener'
        '409':
          description: Listener already exists
      callbacks:
        onJobStatusUpdate:
          '{$request.query.jobUrl}':
            put:
              description: |
                For jobs, the following conditions trigger event callbacks,
                - when status code matches codes defined on the listener
                - when job is archived, unarchived or deleted
                - when error flag changes
              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/JobStatusUpdateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onAssetTaskStatusUpdate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                For asset tasks, the following conditions trigger event callbacks,
                - when status code matches codes defined on the listener
                - when error flag changes
              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/AssetTaskStatusUpdatesBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onSupportAssetCreate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                (Preview Feature) For support assets, the following conditions trigger event callbacks,
                - when support asset is created

              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/SupportAssetCreateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
        onTmUpdateCreate:
          '{$request.query.assetTaskUrl}':
            put:
              description: |
                (Preview Feature) For tmupdates, the following conditions trigger event callbacks,
                - when tmupdate is created
              parameters:
                - $ref: '#/components/parameters/callbackAuthTokenParam'
              requestBody:
                $ref: '#/components/requestBodies/TMUpdateCreateBody'
              responses:
                '200':
                  description: Your server returns this code if it accepts the callback
    get:
      tags:
        - Listener
      summary: Query listener by providerId.
      description: Query listener by providerId.
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listener'
  '/listeners/{listenerId}':
    parameters:
      - $ref: '#/components/parameters/listenerIdParam'
    get:
      tags:
        - Listener
      summary: Gets detail of a listener (Preview Feature)
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listener'


    patch:
      tags:
        - Listener
      summary: Update callback URLs of a listener (Preview Feature)
      requestBody:
        $ref: '#/components/requestBodies/PatchListener'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listener'


    delete:
      tags:
        - Listener
      summary: Deletes a listener (Preview Feature)
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'


  '/providers/{providerId}/jobs':
    get:
      tags:
        - Job
      summary: Gets list of unarchived jobs
      description: Jobs are ordered by creation time, earliest first, by default.
      operationId: GetJobs
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/navNextParam'
        - name: hideAcknowledged
          in: query
          description: The default value is true, only list jobs having isAcknowledged equals false. For more details, see isAcknowledged field on Job.
          schema:
            type: boolean
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobArray'
          links:
            GetNext:
              operationId: GetJobs
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  '/providers/{providerId}/jobs/findByStatus':
    get:
      tags:
        - Job
      summary: Finds unarchived jobs by status
      operationId: FindJobsByStatus
      description: Multiple status values can be provided with comma separated strings
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - name: status
          in: query
          description: Status value considered for filter
          required: true
          explode: true
          schema:
            $ref: '#/components/schemas/JobStatusCodeEnum'
        - name: hideAcknowledged
          in: query
          description: The default value is true, only list jobs having isAcknowledged equals false. For more details, see isAcknowledged field on Job.
          schema:
            type: boolean
        - $ref: '#/components/parameters/navNextParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobArray'
          links:
            GetNext:
              operationId: FindJobsByStatus
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


  '/providers/{providerId}/jobs/{jobId}':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
      - $ref: '#/components/parameters/jobIdParam'
    get:
      tags:
        - Job
      summary: Gets details of a job
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


    put:
      deprecated: true
      tags:
        - Job
      summary: Update provider-specific details of the job
      description: Use this to update the job fields specific to the provider.
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateJob'
        required: true

    patch:
      tags:
        - Job
      summary: Update status and error of the job
      description: Use this to update the job status, error message, and other fields. State transitions are restricted. Only fields specific to the provider are allowed.
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchJob'
        required: true


  '/providers/{providerId}/jobs/{jobId}/cancel':
    put:
      tags:
        - Job
      summary: Cancels a job
      description: A convenience method that can be used to cancel a job completely.  Please note that ALL underlying asset task states are set to CANCELLED by this call.  To cancel a job without affecting asset tasks, use the PATCH method on the job instead.
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelJob'


  '/providers/{providerId}/jobs/{jobId}/supportAssets':
    get:
      tags:
        - SupportAsset
      summary: Gets the list of support assets
      operationId: GetSupportAssets
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/navNextParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportAssetArray'
          links:
            GetNext:
              operationId: GetSupportAssets
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


  '/providers/{providerId}/jobs/{jobId}/supportAssets/{supportAssetId}':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
      - $ref: '#/components/parameters/jobIdParam'
      - $ref: '#/components/parameters/supportAssetIdParam'
    get:
      tags:
        - SupportAsset
      summary: Gets the support asset metadata
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportAsset'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


  '/providers/{providerId}/jobs/{jobId}/assetTasks':
    get:
      tags:
        - AssetTask
      summary: Gets the list of asset tasks
      operationId: GetAssetTasks
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/navNextParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTaskArray'
          links:
            GetNext:
              operationId: GetAssetTasks
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


    patch:
      tags:
        - AssetTask
      summary: Updates a list of asset tasks
      description: Updates a list of asset tasks.  Allows up to N asset tasks per call. Clears error flag and message when they are not in the request.
      operationId: PatchAssetTasks
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Asset tasks that need to be updated
              properties:
                assetTaskIds:
                  type: array
                  items:
                    type: string
                    description: assetTaskId
                assetTasksUpdate:
                  $ref: '#/components/schemas/AssetTasksPatch'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTaskArray'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

    put:
      deprecated: true
      tags:
        - AssetTask
      summary: Updates a list of asset tasks
      description: Updates a list of asset tasks.  Allows up to N asset tasks per call. Clears error flag and message when they are not in the request.
      operationId: UpdateAssetTasks
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Asset tasks that need to be updated
              properties:
                assetTaskIds:
                  type: array
                  items:
                    type: string
                    description: assetTaskId
                assetTasksUpdate:
                  $ref: '#/components/schemas/AssetTasksUpdate'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTaskArray'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'


  '/providers/{providerId}/jobs/{jobId}/assetTasks/{assetTaskId}':
    parameters:
      - $ref: '#/components/parameters/providerIdParam'
      - $ref: '#/components/parameters/jobIdParam'
      - $ref: '#/components/parameters/assetTaskIdParam'
    get:
      tags:
        - AssetTask
      summary: Gets the asset task details
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTask'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

    patch:
      tags:
        - AssetTask
      summary: Updates the asset task
      description: Updates the asset task. Clears error flag and message when they are not in the request.
      requestBody:
        $ref: '#/components/requestBodies/AssetTaskPatch'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTask'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      deprecated: true
      tags:
        - AssetTask
      summary: Updates the asset task
      description: Updates the asset task. Clears error flag and message when they are not in the request.
      requestBody:
        $ref: '#/components/requestBodies/AssetTaskUpdate'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetTask'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  '/providers/{providerId}/jobs/{jobId}/tmupdates/{tmupdateId}':
    get:
      summary: Get a specific translation memory update.
      description: Get a specific user-submitted translation memory update of a translation job.
      tags:
        - TranslationMemory
      parameters:
        - name: providerId
          in: path
          description: Provider ID.
          required: true
          schema:
            type: string
        - name: jobId
          in: path
          description: Job ID.
          required: true
          schema:
            type: string
        - name: tmupdateId
          in: path
          description: TMUpdate ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: success, return translation memory data.
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TMUpdate'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  '/providers/{providerId}/jobs/{jobId}/tmupdates/{tmupdateId}/sourceFile':
    get:
      tags:
        - FileTransfer
      summary: Gets the source file binary
      description: 'Gets the source file binary. The method returns a 307 response code. Clients are expected to follow the url in the Location header.  Most HTTP client libraries do this automatically or can be enabled by a configuration setting. For example, cURL has a -L option.'
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/tmupdateIdParam'
      responses:
        '200':
          description: Placeholder response code for client codegen.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: Redirect
          headers:
            Location:
              schema:
                type: string
              description: URL to follow.

  '/providers/{providerId}/jobs/{jobId}/tmupdates':
    get:
      summary: Get translation memory updates.
      description: Get user-submitted translation memory updates of a translation job.
      tags:
        - TranslationMemory
      parameters:
        - $ref: '#/components/parameters/providerIdParam'
        - $ref: '#/components/parameters/jobIdParam'
        - $ref: '#/components/parameters/navNextParam'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TMUpdatesArray'
          links:
            GetNext:
              operationId: GetTMUpdates
              parameters:
                navNext: '$response.body#/pagination/navNext'
              description: |
                The `navNext` value returned in the response can be used as the `navNext` parameter to get the next page.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /listeners/{listenerId}/{listenerType}/invocations/{invocationId}/retry:
    put:
      tags:
        - Listener
      summary: Retry a failed invocation
      operationId: resendFailedPayload
      description: |
        Retry a failed invocation
      parameters:
        - in: path
          required: true
          name: listenerId
          description: ID of listener
          schema:
            type: string
        - in: path
          required: true
          name: listenerType
          description: Type of listener, possible values job, assetTask
          schema:
            type: string
        - in: path
          required: true
          name: invocationId
          description: ID of invocation
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invocation'
        '400':
          description: bad input parameter
        '404':
          description: The webhook or the invoocationn not found
  /listeners/{listenerType}/{listenerId}/retry:
    put:
      tags:
        - Listener
      summary: Retry a list of failed invocations
      operationId: resendFailedPayloads
      description: |
        Retry a list of failed invocations
      parameters:
        - in: path
          required: true
          name: listenerId
          description: ID of listener
          schema:
            type: string
        - in: path
          required: true
          name: listenerType
          description: Type of listener, possible values job, assetTask
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/InvocationsRetryBody'
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocationsArray'
        '400':
          description: bad input parameter
        '404':
          description: The webhook or the invoocationn not found

  '/listeners/{listenerId}/{listenerType}/invocations/pending':
    get:
      summary: List failed payloads being retried.
      description: List failed payloads that are currently being retried
      parameters:
        - name: listenerId
          in: path
          description: The ID of the Listener.
          required: true
          schema:
            type: string
        - in: path
          required: true
          name: listenerType
          description: Type of listener, possible values job, assetTask
          schema:
            type: string
        - in: query
          name: earliest
          description: query the payloads after it. If not specified, only failures within the last 24 hours are returned.
          schema:
            type: string
        - $ref: '#/components/parameters/navNextParam'
      tags:
        - Listener
      responses:
        '200':
          description: 'success'
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocationsArray'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  '/listeners/{listenerId}/{listenerType}/invocations/failed':
    get:
      summary: List failed payloads not being retried.
      description: List failed payloads that are considered in error and not being retried
      parameters:
        - name: listenerId
          in: path
          description: The ID of the Listener.
          required: true
          schema:
            type: string
        - in: path
          required: true
          name: listenerType
          description: Type of listener, possible values job, assetTask
          schema:
            type: string
        - in: query
          name: earliest
          description: query the payloads after it. If not specified, only failures within the last 24 hours are returned.
          schema:
            type: string
        - $ref: '#/components/parameters/navNextParam'
      tags:
        - Listener
      responses:
        '200':
          description: 'success'
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocationsArray'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  /providerType:
    get:
      tags:
        - ProviderType
      summary: Get all providerType objects
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProviderType'
    post:
      tags:
        - ProviderType
      summary: Only Admin user can create a ProviderType
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProviderType'

      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderType'

  /providerType/{providerTypeId}:
    get:
      tags:
        - ProviderType
      summary: Get a ProviderType object by ID
      parameters:
        - $ref: '#/components/parameters/providerTypeIdParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderType'
        '404':
          description: ProviderType object not found

    patch:
      tags:
        - ProviderType
      summary: Only Admin user can update a ProviderType object by ID
      parameters:
        - $ref: '#/components/parameters/providerTypeIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchProviderType'

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderType'
        '404':
          description: ProviderType object not found

    delete:
      tags:
        - ProviderType
      summary: Only Admin user can delete a ProviderType object by ID
      parameters:
        - $ref: '#/components/parameters/providerTypeIdParam'
      responses:
        '204':
          description: No Content
        '404':
          description: ProviderType object not found

components:
  parameters:
    providerTypeIdParam:
      in: path
      name: providerTypeId
      description: ID of provider type
      required: true
      schema:
        type: string
    providerIdParam:
      in: path
      name: providerId
      description: ID of provider
      required: true
      schema:
        type: string
    jobIdParam:
      name: jobId
      in: path
      description: ID of job
      required: true
      schema:
        type: string
    supportAssetIdParam:
      name: supportAssetId
      in: path
      description: ID of support asset
      required: true
      schema:
        type: string
    assetIdParam:
      name: assetId
      in: path
      description: ID of asset
      required: true
      schema:
        type: string
    assetTaskIdParam:
      name: assetTaskId
      in: path
      description: ID of asset task
      required: true
      schema:
        type: string
    tmupdateIdParam:
      name: tmupdateId
      in: path
      description: ID of TM update
      required: true
      schema:
        type: string
    fileIdParam:
      name: fileId
      in: path
      description: ID of file
      required: true
      schema:
        type: string
    multipartIdParam:
      name: multipartId
      in: path
      description: ID of multipart upload
      required: true
      schema:
        type: string
    listenerIdParam:
      name: listenerId
      in: path
      description: ID of listener
      required: true
      schema:
        type: string
    navNextParam:
      name: navNext
      in: query
      description: ID for next page
      schema:
        type: string
    providerIdQueryParam:
      in: query
      name: providerId
      description: ID of provider
      required: true
      schema:
        type: string
    jobUrlQueryParam:
      name: jobUrl
      in: query
      allowEmptyValue: true
      description: |
        the location where data will be sent for job status updates.  Must be network accessible
        by the source server. Can be empty.
      schema:
        type: string
        format: uri
        description: 'example:https://tonys-server.com'
    assetTaskUrlQueryParam:
      name: assetTaskUrl
      in: query
      allowEmptyValue: true
      description: |
        the location where data will be sent for asset task status updates.  Must be network accessible
        by the source server. Can be empty.
      schema:
        type: string
        format: uri
        description: 'example:https://tonys-server.com'
    callbackAuthTokenParam:
      name: x-lionbridge-providerapi-signature
      in: header
      description: |
        HMAC signature in header. Please visit [optional-signature-validation](https://connectordocs.lionbridge.com/provider/listeners/#optional-signature-validation) for more information on usage.
      schema:
        type: string
    authTypeParam:
      name: authType
      in: query
      description: Specify the type of authentication to be used for securing callback request.
      schema:
        $ref: '#/components/schemas/ListenerAuthEnum'
    authSecretParam:
      name: authSecretParam
      in: query
      schema:
        type: string
        maxLength: 30
  schemas:

    ProviderType:
      type: object
      required:
        - name
        - schema
      properties:
        id:
          type: string
        templateId:
          type: integer
          description: the template id of provider type
        name:
          type: string
          description: the name of provider type
        schema:
          $ref: '#/components/schemas/ProviderTypeSchema'

    CreateProviderType:
      type: object
      required:
        - name
        - schema
      properties:
        templateId:
          type: integer
          description: the template id of provider type, the default value is 0 that means ignore the validation for `providerParameters` when creating Provider
          default: 0
        name:
          type: string
          description: the name of provider type
        schema:
          type: object
          additionalProperties:
            type: object
          description: the JSON schema of provider type

    PatchProviderType:
      properties:
        templateId:
          type: integer
          description: the template id of provider type
        name:
          type: string
          description: the name of provider type
        schema:
          type: object
          additionalProperties:
            type: object
          description: the JSON schema of provider type

    Error:
      required:
        - code
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string

    JobStatusCodeEnum:
      type: string
      enum:
        - SENDING
        - SENDING_READY_FOR_RETRIEVE
        - SENT_TO_TRANSLATOR
        - IN_TRANSLATION
        - COMPLETED
        - CANCELLED

    AssetTaskStatusCodeEnum:
      type: string
      enum:
        - SENDING
        - SENDING_READY_FOR_RETRIEVE
        - SENT_TO_TRANSLATOR
        - IN_TRANSLATION
        - TRANSLATION_SUBMITTED
        - TRANSLATION_ACKNOWLEDGED # keep, only for backwards compat
        - TRANSLATION_REJECTED
        - TRANSLATION_APPROVED

        - CANCELLED

    ProviderStatusCodeEnum:
      description: |
        Subset of StatusCodeEnum that a provider can set. A disabled provider isn't be able to create job for it.
        - ENABLED 
        - DISABLED
      type: string

    ProviderUpdateStatusCodeEnum:
      description: |
        Subset of StatusCodeEnum that a provider can set

        - SENT_TO_TRANSLATOR
        - IN_TRANSLATION
        - TRANSLATION_SUBMITTED
        - CANCELLED
      type: string


    ProviderJobUpdateStatusCodeEnum:
      description: |
        Subset of StatusCodeEnum that a provider can set on a Job

        - IN_TRANSLATION
        - CANCELLED
      type: string


    ProviderListenerJobStatusCodeEnum:
      description: |
        Subset of StatusCodeEnum that a provider can receive as listener events

        - SENDING_READY_FOR_RETRIEVE
        - COMPLETED
        - CANCELLED
      type: string


    ProviderListenerAssetTaskStatusCodeEnum:
      description: |
        Subset of StatusCodeEnum that a provider can receive as listener events

        - SENDING_READY_FOR_RETRIEVE
        - TRANSLATION_REJECTED
        - TRANSLATION_APPROVED
        - CANCELLED
      type: string



    CreateProvider:
      type: object
      required:
        - name
        - siteId
        - type
      properties:
        name:
          type: string
          description: 'example:ACMEFreewayProvider'
        siteId:
          type: string
          description: 'example:12345678 (kc:should this be the siteId, or an org name, i.e. string search. The siteId right now is ZD org id that should be considered an implementation detail)'
        capabilities:
          $ref: '#/components/schemas/Capabilities'
        type:
          type: string
          description: Type of the provider, call GET /providerType to see all provider types and use `name` for this field, see ProviderType model for details.
        providerParameters:
          $ref: '#/components/schemas/ProviderTypeSchema'
          description: a json structure that should match the `schema` of ProviderType model. It would be ignored if `templateId` of ProviderType is 0.
        status:
          $ref: '#/components/schemas/ProviderStatusCodeEnum'
    Provider:
      required:
        - name
        - siteId
      properties:
        name:
          type: string
          description: 'example:ACMEFreewayProvider'
        siteId:
          type: string
          description: The ID of the organization of the translation provider
        capabilities:
          $ref: '#/components/schemas/Capabilities'
        id:
          type: string
        creatorId:
          type: string
          description: The ID of the user who is creating the translation provider.
        type:
          type: string
          description: Type of the provider
        providerParameters:
          $ref: '#/components/schemas/ProviderTypeSchema'
        status:
          $ref: '#/components/schemas/ProviderStatusCodeEnum'
        isDeleted:
          description: indicates whether a provider is deleted.
          type: boolean
        warnMessage:
          description: Warn message of the provider
          type: string
    ProviderInfo:
      properties:
        id:
          type: string
        name:
          type: string
          description: 'example:ACMEFreewayProvider'
        connectorsName:
          type: string
          description: Name of connector
        status:
          type: string
          description: Provider Status
        jobTotalCount:
          type: integer
          description: Number of jobs
        firstJobCreatedDate:
          type: string
          format: date-time
          description: Date-time signature of when the first job was created.
        lastJobCreatedDate:
          type: string
          format: date-time
          description: Date-time signature of when the last job was created.
    UpdateProvider:
      properties:
        name:
          type: string
          description: 'example:ACMEFreewayProvider'
        capabilities:
          $ref: '#/components/schemas/Capabilities'
        type:
          type: string
          description: Type of the provider, call GET /providerType to see all provider types and use `name` for this field, see ProviderType model for details.
        providerParameters:
          $ref: '#/components/schemas/ProviderTypeSchema'
          description: a json structure that should match the `schema` of ProviderType model. It would be ignored if `templateId` of ProviderType is 0.
        status:
          $ref: '#/components/schemas/ProviderStatusCodeEnum'
    PatchProvider:
      properties:
        name:
          type: string
          description: 'example:ACMEFreewayProvider'
        capabilities:
          $ref: '#/components/schemas/Capabilities'
        type:
          type: string
          description: Type of the provider
        status:
          $ref: '#/components/schemas/ProviderStatusCodeEnum'
    Capabilities:
      type: object
      properties:
        supportedLanguages:
          type: array
          items:
            $ref: '#/components/schemas/LanguagePairs'
        supportQuote:
          type: boolean
          default: false
        supportUpdateTM:
          type: boolean
          default: false
        supportedServiceTypes:
          type: array
          items:
            type: string
          description: 'A list of supported service or workflow the provider can use to send translation jobs. When this is empty, there is no validation on the “serviceType” parameter when creating/submitting jobs or adding requests to the jobs.'
        supportedFileExtensions:
          type: array
          items:
            type: string
          description: A list of supported file extensions.
        requiredJobFields:
          deprecated: true
          type: array
          items:
            type: string
          description: A list of required job fields.
        extendedMetadataSchema:
          $ref: '#/components/schemas/ExtendedMetadataSchema'
        jobSchema:
          $ref: '#/components/schemas/JobSchema'
    LanguagePairs:
      type: object
      properties:
        sources:
          type: array
          items:
            type: string
        targets:
          type: array
          items:
            type: string
    Job:
      type: object
      required:
        - jobName
      properties:
        jobId:
          type: string
          description: Unique identifier representing a translation job.
        jobName:
          type: string
          description: The name of the translation job.
        description:
          type: string
          description: A description of the translation job.
        statusCode:
          $ref: '#/components/schemas/JobStatusCodeEnum'
        hasError:
          type: boolean
          description: If the translation request currently has an error.
        latestErrorMessage:
          type: string
          description: The most recent error message affecting the translation request.
        submitterId:
          type: string
          description: The ID of the user who is submitting the translation job.
        creatorId:
          type: string
          description: The ID of the user who is creating the translation job.
        siteId:
          type: string
          description: The ID of the organization of the translation provider
        providerId:
          type: string
          description: The ID of the provider that the translation job will be submitted to.
        providerReference:
          type: string
          description: 'Provider-specific reference of the translation job. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
        poReference:
          type: string
          description: Purchase Order (PO) Reference of the translation job.
        dueDate:
          type: string
          format: date-time
          description: Due date of the translation job.
        createdDate:
          type: string
          format: date-time
          description: Date-time signature of when the translation job was created.
        modifiedDate:
          type: string
          format: date-time
          description: Date-time signature of when the translation job was last modified.
        archived:
          type: boolean
          description: If the translation job has been archived.
        customData:
          type: string
          description: User specified custom data.
        shouldQuote:
          description: |
            Request a quote for the job before translation proceeds.  TODO -
            describe how quoting happens outside of REST API.
          type: boolean
          default: false
        connectorName:
          description: |-
            The official/descriptive name of the connector that is sending the job.
            If required, for connector certification, please contact Lionbridge connector support.
          type: string
        connectorVersion:
          description: The version number of the connector that is sending the job.
          type: string
        serviceType:
          description: The type of service or workflow requested for the job.
          type: string
        extendedMetadata:
          $ref: '#/components/schemas/ExtendedMetadata'
        labels:
          $ref: '#/components/schemas/Labels'
        globalTrackingId:
          description: The global tracking ID is used to identify jobs across various Lionbridge services.
          type: string
        assetTaskCount:
          description: total number of asset tasks for the job
          type: integer
        supportAssetTaskCount:
          description: total number of asset tasks when job send is finished
          type: integer
        isAcknowledged:
          description: Optional field that indicates whether a job should be visible when listing jobs. This may be useful for use case where a job needs to be in preprocessed before setting its state to IN_TRANSLATION, but should no longer be visible when polling with GET /jobs.
          type: boolean
    SupportAsset:
      required:
        - supportAssetId
        - fileId
        - jobId
        - filename
        - filetype
      properties:
        supportAssetId:
          type: string
          description: Unique identifier representing support asset.
        fileId:
          type: string
          description: Unique identifier representing asset file.
        jobId:
          type: string
          description: Unique identifier representing a translation job.
        filename:
          type: string
          description: Name of file
        filetype:
          type: string
          description: Type of file.
        description:
          description: An optional description of this support asset.
          type: string
          maxLength: 2000
        sourceNativeIds:
          type: array
          items:
            type: string
          description: >-
            Optional source native id's associated with this support asset.  This field is for informational purpose only, and is not validated by the API. See Request's sourceNativeId for a detailed description.
          maxLength: 1000
        sourceNativeLanguageCode:
          type: string
          description: Optional source language code associated with this support asset.  This field is for informational purpose only, and is not validated by the API.
        targetNativeLanguageCodes:
          type: array
          description: Optional list of target languages of support asset associated with this support asset.  This field is for informational purpose only, and is not validated by the API.
          items:
            type: string
        extendedMetadata:
          $ref: '#/components/schemas/ExtendedMetadata'
    AssetTask:
      required:
        - assetTaskId
        - fileId
        - jobId
        - statusCode
        - sourceNativeLanguageCode
        - targetNativeLanguageCode
        - filename
        - filetype
        - translatedFileId
      properties:
        assetTaskId:
          type: string
          description: Unique identifier representing asset task.
        fileId:
          type: string
          description: Unique identifier representing asset file.
        jobId:
          type: string
          description: Unique identifier representing a translation job.
        filename:
          type: string
          description: Name of file
        filetype:
          type: string
          description: Type of file.
        requestName:
          type: string
          description: Translation request name.
        statusCode:
          $ref: '#/components/schemas/AssetTaskStatusCodeEnum'
        hasError:
          type: boolean
          description: If the translation request currently has an error.
        latestErrorMessage:
          type: string
          description: The message for the most recent error affecting a translation request.
        sourceNativeLanguageCode:
          type: string
          description: Source language code of the request in the content system.
        targetNativeLanguageCode:
          type: string
          description: Target language code of the request in the content system.
        createdDate:
          type: string
          format: date-time
          description: Date-time signature of when the asset was created.
        modifiedDate:
          type: string
          format: date-time
          description: Date-time signature of when the asset was last modified.
        rejectNote:
          type: string
          description: The reason for rejection
        translatedFileId:
          type: string
          description: Unique identifier representing asset file.
        providerReference:
          type: string
          maxLength: 1000
          description: 'Provider-specific reference of the translation asset task. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
        extendedMetadata:
          $ref: '#/components/schemas/ExtendedMetadata'
    AssetTaskPatch:
      properties:
        reference:
          type: string
          description: 'Provider-specific reference of the asset task. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
          nullable: true
        statusCode:
          $ref: '#/components/schemas/ProviderUpdateStatusCodeEnum'
        translatedFileId:
          type: string
          description: Unique identifier representing asset file. Used when a translation is uploaded and ready for review.  File must be fully uploaded when this method is invoked.
          nullable: true
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
          nullable: true
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
    AssetTaskUpdate:
      properties:
        reference:
          type: string
          description: 'Provider-specific reference of the asset task. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
        statusCode:
          $ref: '#/components/schemas/ProviderUpdateStatusCodeEnum'
        translatedFileId:
          type: string
          description: Unique identifier representing asset file. Used when a translation is uploaded and ready for review.  File must be fully uploaded when this method is invoked.
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
    AssetTasksPatch:
      properties:
        reference:
          type: string
          description: Arbitrary info regarding the asset task update.
          nullable: true
        statusCode:
          $ref: '#/components/schemas/ProviderUpdateStatusCodeEnum'
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
          nullable: true
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
    AssetTasksUpdate:
      properties:
        reference:
          type: string
          description: Arbitrary info regarding the asset task update.
        statusCode:
          $ref: '#/components/schemas/ProviderUpdateStatusCodeEnum'
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
    CancelJob:
      properties:
        message:
          type: string
          description: Message regarding the job cancellation.  Intended to be human readable.
          nullable: true
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
    UpdateJob:
      properties:
        providerReference:
          type: string
          maxLength: 1000
          description: 'Provider-specific reference of the translation job. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
    PatchJob:
      description: Fields are applied as updates to the job.
      properties:
        providerReference:
          type: string
          maxLength: 1000
          description: 'Provider-specific reference of the translation job. This field is optional, and can contain supplementary information when communicating with the translation provider outside of the API.'
          nullable: true
        statusCode:
          $ref: '#/components/schemas/ProviderJobUpdateStatusCodeEnum'
        isAcknowledged:
          type: boolean
          description: Optional field that indicates whether a job should be visible when listing jobs. This may be useful for use case where a job needs to be in preprocessed before setting its state to IN_TRANSLATION, but should no longer be visible when polling with GET /jobs.
          nullable: true
        latestErrorMessage:
          type: string
          description: The most recent error message reflecting the overall job. Setting the message will also set the error flag of the job.  Conversely, setting to null clears the error flag.
          nullable: true

    Listener:
      required:
        - listenerId
        - uri
        - type
      properties:
        listenerId:
          description: The Id of the Listener.
          type: string
        providerId:
          description: 'The provider associated with the listener. If not specified, then the listener applies to all providers without listeners.'
          type: string
        jobUri:
          description: The URI that API should ping once a job event has fired.
          type: string
        assetTaskUri:
          description: The URI that API should ping once an asset task event has fired.
          type: string
        authType:
          $ref: '#/components/schemas/ListenerAuthEnum'
        jobStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - COMPLETED
              - CANCELLED
        assetTaskStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - TRANSLATION_REJECTED
              - TRANSLATION_APPROVED
              - CANCELLED
        onSupportAssetCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when support assets are created.
          default: false
          nullable: true

        onTmUpdateCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when TMUpdates are created.
          default: false
          nullable: true
        jobListenerDisabled:
          type: boolean
          description: When this flag is set to true, that means the Webhook for Job updates is disabled, because the webhook endpoint doesn't work as expected.
          default: false
        assetTaskListenerDisabled:
          type: boolean
          description: When this flag is set to true, that means the Webhook for AssetTask is disabled, because the webhook endpoint doesn't work as expected.
          default: false
        isDeleted:
          type: boolean
          description: When this flag is set to true, that means the related provider has been deleted.

    CreateListener:
      type: object
      properties:
        jobUri:
          description: The URI that API should send request to once a job event has fired.
          type: string
          format: uri
        assetTaskUri:
          description: The URI that API should send request to once an asset task or tmupdate event has fired.
          type: string
          format: uri
        authType:
          $ref: '#/components/schemas/ListenerAuthEnum'
        authSecret:
          description: The secret used to generate authentication header, when LB_PROVIDERAPI_SIGNATURE authType is selected.
          type: string
        jobStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - COMPLETED
              - CANCELLED
        assetTaskStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - TRANSLATION_REJECTED
              - TRANSLATION_APPROVED
              - CANCELLED
        onSupportAssetCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when support assets are created.
          default: false
          nullable: true

        onTmUpdateCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when TMUpdates are created.
          default: false
          nullable: true

    PatchListener:
      type: object
      properties:
        jobUri:
          description: The URI that API should send request to once a job event has fired.
          type: string
          format: uri
          nullable: true
        assetTaskUri:
          description: The URI that API should send request to once an asset task or tmupdate event has fired.
          type: string
          format: uri
          nullable: true
        jobStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - COMPLETED
              - CANCELLED
        assetTaskStatusCodes:
          type: array
          items:
            type: string
            description: |
              Subset of StatusCodeEnum that a provider can receive as listener events

              - SENDING_READY_FOR_RETRIEVE
              - TRANSLATION_REJECTED
              - TRANSLATION_APPROVED
              - CANCELLED

        onSupportAssetCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when support assets are created.
          default: false
          nullable: true

        onTmUpdateCreate:
          type: boolean
          description: |
            (Preview Feature) Whether to generate listener events when TMUpdates are created.
          default: false
          nullable: true


    ListenerAuthEnum:
      type: string
      description: |
        Authentication type for listener.
          - LB_PROVIDERAPI_SIGNATURE: HMAC signature in header
      # enum:
      #   - LB_PROVIDERAPI_SIGNATURE

    BaseStatusUpdate:
      type: object
      properties:
        providerId:
          type: string
        jobId:
          type: string
        eventType:
          type: string
          description: |
            Valid values are: JOB_UPDATE, ASSET_TASK_UPDATE, SUPPORT_ASSET_CREATE, TMUPDATE_CREATE
        updateTime:
          type: string
          format: date-time
          description: Date-Time of the status update.

    JobStatusUpdate:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseStatusUpdate'
      properties:
        eventType:
          type: string
          description: for Job updates, this is set to JOB_UPDATE
        statusCode:
          $ref: '#/components/schemas/ProviderListenerJobStatusCodeEnum'
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
        archived:
          type: boolean
          description: If the translation job has been archived.
        deleted:
          type: boolean
          description: If the translation job has been deleted.
        # job:
        #   $ref: '#/components/schemas/Job'

    AssetTaskStatusUpdate:
      type: object
      properties:
        assetTaskId:
          type: string
        statusCode:
          $ref: '#/components/schemas/ProviderListenerAssetTaskStatusCodeEnum'
        message:
          type: string
          description: Message regarding the asset task update.  Intended to be human readable.
        isError:
          type: boolean
          description: Set to True if this update is communicating an error.
      required:
        - assetTaskId
    AssetTaskStatusUpdates:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseStatusUpdate'
      properties:
        # providerId:
        #   type: string
        eventType:
          type: string
          description: for AssetTask updates, this is set to ASSET_TASK_UPDATE
        assetTaskStatusUpdates:
          type: array
          items:
            $ref: '#/components/schemas/AssetTaskStatusUpdate'

    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
        type:
          type: string
        message:
          type: string

    Pagination:
      type: object
      description: Data for pagination
      properties:
        navNext:
          type: string
          description: token/cursor for next page. Can be null.
    TMUpdate:
      required:
        - tmupdateId
        - jobId
        - fileId
        - fileName
        - fileType
        - sourceNativeLanguageCode
        - targetNativeLanguageCode
      properties:
        tmupdateId:
          type: string
          description: Unique identifier representing a translation memory.
        jobId:
          type: string
          description: Unique identifier representing a translation job.
        fileId:
          type: string
          description: FMS fileId of file containing updated content to use in this UpdateTM.
        fileType:
          type: string
          description: Type of file.
        fileName:
          type: string
          description: Name of file
        sourceNativeLanguageCode:
          type: string
          description: Source language code of the update in the content system.
        targetNativeLanguageCode:
          type: string
          description: Target language code of the update in the content system.
        extendedMetadata:
          $ref: '#/components/schemas/ExtendedMetadata'
    TMUpdatesArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        tmUpdates:
          type: array
          items:
            $ref: '#/components/schemas/TMUpdate'
    ProviderArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        providers:
          type: array
          items:
            $ref: '#/components/schemas/Provider'
    ProviderInfoArray:
      type: object
      properties:
        providers:
          type: array
          items:
            $ref: '#/components/schemas/ProviderInfo'
    ListenerArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        listeners:
          type: array
          items:
            $ref: '#/components/schemas/Listener'
    JobArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/Job'
    SupportAssetArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        supportAssets:
          type: array
          items:
            $ref: '#/components/schemas/SupportAsset'
    AssetTaskArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        assetTasks:
          type: array
          items:
            $ref: '#/components/schemas/AssetTask'
    InvocationsArray:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        invocations:
          type: array
          items:
            $ref: '#/components/schemas/Invocation'
    ExtendedMetadata:
      description: |
        Free-form metadata.
        Note that a Job's ExtendedMetadata is subject to additional validation required
        by the Provider's ExtendedMetadataSchema, if defined.  For more information, visit <https://json-schema.org/>.
      type: object
      additionalProperties:
        type: object
      example:
        previewUrl: https://preview.lionbridge.com/look/at/me
        fruit: kiwi

    ExtendedMetadataSchema:
      deprecated: true
      type: object
      additionalProperties:
        type: object
      description: |
        Extended metadata schema as JSON Schema (draft V4). For more information, visit <https://json-schema.org/>.
    JobSchema:
      type: object
      additionalProperties:
        type: object
      description: |
        Job schema as JSON Schema (draft V4). For more information, visit <https://json-schema.org/>.
    ProviderTypeSchema:
      type: object
      additionalProperties:
        type: object
      description: |
        ProviderType schema as JSON Schema (draft V4). For more information, visit <https://json-schema.org/>.
    FMSTransferObject:
      required:
        - fmsSASToken
        # - jobId
      allOf:
        - $ref: '#/components/schemas/FMSFileInfo'
      properties:
        fmsSASToken:
          type: string
          description: FMS SAS Token
        fmsUploadUrl:
          type: string
          description: FMS Upload URL for TUS client
        fmsPostMultipartUrl:
          type: string
          description: FMS Upload URL for Direct Upload POSTing multipart/form-data
        # jobId:
        #   type: string
        #   description: Unique identifier representing a translation job.

    FMSFileInfo:
      required:
        - fmsFileId
      #        - fmsFolderId
      #        - fmsContainerId
      properties:
        fmsFileId:
          type: string
          description: FMS fileId.
          example: c0ffee
    #        fmsFolderId:
    #          type: string
    #          description: FMS FolderId.
    #          example: a0b1c2-job0-5678
    #        fmsContainerId:
    #          type: string
    #          description: FMS ContainerId.
    #          example: ACMECorp#HR#CAN

    Labels:
      description: |
        Free-form metadata that can be used for queries. Labels are key/value pairs.

        Valid label keys must be:

          - 63 characters or less (cannot be empty)
          - must begin and end with an alphanumeric character ([a-z0-9A-Z])
          - could contain underscores (_) and alphanumerics between.

        Valid label values must be:

          - 255 characters or less (cannot be empty)

        Non-identifying information should be recorded using the ExtendedMetadata field instead, where these restrictions do not apply.

      type: object
      additionalProperties:
        type: object
      maxProperties: 10
      example:
        env: staging1
        priority: 3

    SupportAssetCreate:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseStatusUpdate'
      properties:
        eventType:
          type: string
          description: for SupportAssetCreate, this is set to SUPPORT_ASSET_CREATE
        supportAssetIds:
          type: array
          items:
            type: string
            description: supportAssetIds
    TMUpdateCreate:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseStatusUpdate'
      properties:
        eventType:
          type: string
          description: for TMUpdateCreate, this is set to TMUPDATE_CREATE
        tmupdateId:
          type: string
          description: Unique identifier representing a translation memory.
    Invocation:
      properties:
        id:
          type: string
          description: Id of the invocation.
        endpoint:
          type: string
          description: The endpoint of the invocation.
        payloadStatus:
          type: string
          description: The status code of the invocation.
        jobId:
          type: string
          description: The Job ID.
        payload:
          type: string
          description: The payload of the invocation.
        createTime:
          type: string
          format: date-time
          description: Date-time of when the invocation was created.
        lastError:
          type: string
          description: The lastest error message of the invocation.
    InvocationsRetry:
      type: object
      required:
        - invocationIds
      properties:
        invocationIds:
          type: array
          items:
            type: string
            description: List of invocation Ids
    HrefLink:
      type: object
      properties:
        href:
          type: string
          # can't do example because this is common to multiple models
    Links:
      type: object
      description: Data for navigation
      properties:
        next:
          type: object
          $ref: '#/components/schemas/HrefLink'
  requestBodies:
    AssetTaskUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AssetTaskUpdate'
      description: Asset Task Update
      required: true
    AssetTaskPatch:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AssetTaskPatch'
      description: Asset Task Update
      required: true
    CreateProvider:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateProvider'
      required: true
    UpdateProvider:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateProvider'
      required: true
    PatchProvider:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PatchProvider'
    AssetTaskStatusUpdatesBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AssetTaskStatusUpdates'
    JobStatusUpdateBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JobStatusUpdate'
    CreateListener:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateListener'
      required: true
    PatchListener:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PatchListener'
      required: true
    SupportAssetCreateBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SupportAssetCreate'
    TMUpdateCreateBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TMUpdateCreate'
    InvocationsRetryBody:
      description: A JSONN object contains list of invocation Ids to resend
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvocationsRetry'



  securitySchemes:
    bearerAuth:            # arbitrary name for the security scheme
      type: http
      scheme: bearer