openapi: 3.0.3
info:
  title: ''
  version: 0.0.1
  termsOfService: https://hyperscience.com/terms-of-use/
  contact:
    name: Hyperscience
    url: https://www.hyperscience.com
    email: support@hyperscience.com
  license:
    name: Commercial
paths:
  /api/v5/artifacts/{artifact_type}/{artifact_uuid}/dependencies_list:
    get:
      operationId: dependencies_list_retrieve
      description: "Returns a list with the `ArtifactKey`s for all Artifacts the specified
        Artifact depends on. Importing this list on a target system produces an Artifact
        that is functionally-identical to the original one.\n\nThis list includes:
        \n\n   * \"Hard requirements\", enforced at the DB level, i.e. \"parent\"
        objects to this Artifact\n\n   * \"Functional dependencies\", that define
        behavior\n\n   * The specified Artifact itself\n\n\n\nFor Artifacts with no
        dependencies, a single-item list is returned; The ad-hoc `repositories` section
        is never included."
      summary: Returns a list with all the functional dependencies of the specified
        Artifact
      parameters:
      - in: path
        name: artifact_type
        schema:
          type: string
          enum:
          - block
          - block_asset
          - block_asset_chunk
          - confidence_thresholding_model
          - field_id_model
          - flow_version
          - idp_flow_version
          - layout
          - layout_release
          - nlc_model
          - table_id_model
        description: The slug for the Artifact Type - one of the supported values,
          such as `block`, `layout_release`, etc. Together with the Artifact UUID
          they uniquely identify every Artifact.
        required: true
      - in: path
        name: artifact_uuid
        schema:
          type: string
          format: uuid
        description: The UUID of the Artifact. Together with the Artifact Type they
          uniquely identify every Artifact.
        required: true
      tags:
      - dependencies_list
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsList'
              examples:
                A`layoutRelease`ArtifactWithNoDependencies:
                  value:
                    artifacts:
                    - artifact_type: layout_release
                      artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                  summary: A `layout_release` Artifact with no dependencies
                A`flowVersion`ArtifactWithItsUnderlying`block`s:
                  value:
                    artifacts:
                    - artifact_type: block
                      artifact_uuid: 798a30f3-06d7-49dd-8156-fe04b6cab2f2
                      description: CRON_TRIGGER trigger block
                    - artifact_type: block
                      artifact_uuid: 4d61afaf-1638-489b-b131-e75c7bfebc7d
                      description: CUSTOM_CODE simple block
                    - artifact_type: block
                      artifact_uuid: 838583a4-da85-4cf3-88af-35133006a827
                      description: LAMBDA_PYTHON simple block
                    - artifact_type: flow_version
                      artifact_uuid: d85b924a-0165-4d4c-9665-4d219e2d475a
                      description: 'ANALYTICS_CLEAN / '
                  summary: A `flow_version` Artifact with its underlying `block`s
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                GenericErrorJSON:
                  value: '{"error": "Artifacts of type `abcd` are not supported"}'
                  summary: Generic error JSON
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Not-foundErrorJSON:
                  value: '{"error": "BlockDefinition matching query does not exist."}'
                  summary: Not-found error JSON
          description: ''
  /api/v5/artifacts/{artifact_type}/{artifact_uuid}/download:
    get:
      operationId: download_retrieve
      description: 'Produces a file-download response with the binary content of the
        Artifact, specified by the `(artifact_type, artifact_uuid)` pair. Different
        Artifact types are persisted in different binary formats, most commonly: .ZIP,
        .JSON, .BIN, etc.'
      summary: File download endpoint. Provides the binary content of the specified
        Artifact
      parameters:
      - in: path
        name: artifact_type
        schema:
          type: string
          enum:
          - block
          - block_asset
          - block_asset_chunk
          - confidence_thresholding_model
          - field_id_model
          - flow_version
          - idp_flow_version
          - layout
          - layout_release
          - nlc_model
          - table_id_model
        description: The slug for the Artifact Type - one of the supported values,
          such as `block`, `layout_release`, etc. Together with the Artifact UUID
          they uniquely identify every Artifact.
        required: true
      - in: path
        name: artifact_uuid
        schema:
          type: string
          format: uuid
        description: The UUID of the Artifact. Together with the Artifact Type they
          uniquely identify every Artifact.
        required: true
      tags:
      - download
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
                format: binary
              examples:
                SampleArtifactBinary:
                  value: <Binary Content>
                  summary: Sample Artifact binary
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                GenericErrorJSON:
                  value: '{"error": "Artifacts of type `abcd` are not supported"}'
                  summary: Generic error JSON
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Not-foundErrorJSON:
                  value: '{"error": "BlockDefinition matching query does not exist."}'
                  summary: Not-found error JSON
          description: ''
  /api/v5/artifacts/export:
    post:
      operationId: export_create
      description: |-
        Generates a .ZIP file containing all binaries for a list of Artifacts. This file is placed at the specified `destination` path at the specified `storage_type` store.

        Exports to a local file, S3 bucket or GCS bucket are currently supported. In either case the server backend needs access and write permissions to the destination path.

        This operation runs in two phases. First, all Artifacts are "resolved", i.e. they are located across all available Repos. Then starts the actual content export, which runs as an async background process. The `POST` request returns a response when the resolution step is complete and provides a "progress tracking" URL for monitoring the long-running async job.
      summary: Generates a .ZIP file containing all binaries for a list of Artifacts
      tags:
      - export
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportArtifactsPayload'
            examples:
              ExportTwoBlocksToS3.UseAnAd-hocRepo:
                value:
                  artifacts_list:
                    repositories:
                    - name: Public Webserver Repo
                      repo_type: HTTP
                      config:
                        manifest_url: http://www.example.com/repo_manifest.json
                    artifacts:
                    - artifact_type: block
                      artifact_uuid: 4d61afaf-1638-489b-b131-e75c7bfebc7d
                      description: CUSTOM_CODE simple block
                    - artifact_type: block
                      artifact_uuid: 838583a4-da85-4cf3-88af-35133006a827
                      description: LAMBDA_PYTHON simple block
                  storage_type: s3
                  destination: s3://some-bucket/some-prefix/artifacts.zip
                  destination_config:
                    s3_region: us-east-1
                summary: Export two blocks to S3. Use an ad-hoc Repo
              ExportTwoBlocksToGCS.UseAnAd-hocRepo:
                value:
                  artifacts_list:
                    repositories:
                    - name: Public Webserver Repo
                      repo_type: HTTP
                      config:
                        manifest_url: http://www.example.com/repo_manifest.json
                    artifacts:
                    - artifact_type: block
                      artifact_uuid: 4d61afaf-1638-489b-b131-e75c7bfebc7d
                      description: CUSTOM_CODE simple block
                    - artifact_type: block
                      artifact_uuid: 838583a4-da85-4cf3-88af-35133006a827
                      description: LAMBDA_PYTHON simple block
                  storage_type: gcs
                  destination: gs://some-bucket/some-prefix/artifacts.zip
                summary: Export two blocks to GCS. Use an ad-hoc Repo
              ExportALayoutReleaseToALocal.ZIPFile:
                value:
                  artifacts_list:
                    artifacts:
                    - artifact_type: layout_release
                      artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                  storage_type: local
                  destination: /var/www/forms/MyLayoutRelease.zip
                summary: Export a Layout Release to a local .ZIP file
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsExportResponse'
              examples:
                ExportingALayoutReleaseToALocal.ZIPFile:
                  value:
                    resolved_artifacts:
                    - key:
                        artifact_type: layout_release
                        artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                      repo: SELF
                    job_tracking_id: 77003da1-9ac1-45be-90f5-fdbe5c9fbf9a
                    progress_url: /api/job_tracking/77003da1-9ac1-45be-90f5-fdbe5c9fbf9a
                    summary: 'OK: Started background export'
                    zip_location: /var/www/forms/MyLayoutRelease.zip
                  summary: Exporting a Layout Release to a local .ZIP file
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomError'
              examples:
                InvalidPayloadJSONStructure:
                  value:
                    error:
                      summary: Failed to deserialize the input payload.
                      details:
                      - loc:
                        - artifacts
                        - 0
                        - artifact_type
                        msg: field required
                        type: value_error.missing
                  summary: Invalid payload JSON structure
                OneOrMoreArtifactsFailedToResolve:
                  value:
                    error:
                      summary: Failed to resolve Artifacts
                      unresolved_artifacts:
                      - artifact_type: layout_release
                        artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                  summary: One or more Artifacts failed to resolve
          description: ''
  /api/v5/artifacts/import:
    post:
      operationId: import_create
      description: "Submits a list of Artifacts for the server to retrieve and import.
        \n\nArtifacts are retrieved from Artifact Repos. There are several categories
        of repos: \n\n   * Persistent: Defined as `ArtifactsRepository` entities in
        DB\n\n   * Ad-hoc: Specified inline, as part of the `POST` JSON payload. These
        are applicable only for the scope of the current operation. \n\n   * `SELF`:
        Every Hyperscience instance is an Artifacts Repo itself. Artifacts that are
        already present on the instance will not be retrieved and will not be (re-)imported.\n\nThis
        operation runs in two phases. First, all Artifacts are \"resolved\", i.e.
        they are located across all available Repos. Then starts the actual retrieval
        & import, which runs as an async background process. The `POST` request returns
        a response when the resolution step is complete and provides a \"progress
        tracking\" URL for monitoring the long-running async job."
      summary: Submits a list of Artifacts to be imported
      tags:
      - import
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArtifactsList'
            examples:
              ImportTwoBlocks(usingOnlyThePersistent`ArtifactsRepository`Entities):
                value:
                  artifacts:
                  - artifact_type: block
                    artifact_uuid: 4d61afaf-1638-489b-b131-e75c7bfebc7d
                    description: CUSTOM_CODE simple block
                  - artifact_type: block
                    artifact_uuid: 838583a4-da85-4cf3-88af-35133006a827
                    description: LAMBDA_PYTHON simple block
                summary: Import two Blocks (using only the persistent `ArtifactsRepository`
                  entities)
              ImportOneLayoutRelease.UseAnAd-hocPrivateRepoThatRequiresAuthentication.:
                value:
                  repositories:
                  - name: Internal HS Instance
                    repo_type: HTTP
                    config:
                      manifest_url: http://hsapp01.internal.com/api/v5/artifacts/repo_manifest.json
                      headers:
                        Authorization: Bearer a22d533ebaa60ae5d46b2f0ea67532a4eb8e33be
                  artifacts:
                  - artifact_type: layout_release
                    artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                summary: Import one Layout Release. Use an ad-hoc private Repo that
                  requires authentication.
              ImportOneLayoutRelease.UseAnAd-hocRepo(inAdditionToThePersistentOnes):
                value:
                  repositories:
                  - name: Public Webserver Repo
                    repo_type: HTTP
                    config:
                      manifest_url: http://www.example.com/repo_manifest.json
                  artifacts:
                  - artifact_type: layout_release
                    artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                summary: Import one Layout Release. Use an ad-hoc Repo (in addition
                  to the persistent ones)
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsImportResponse'
              examples:
                ImportingOneReleaseArtifact:
                  value:
                    resolved_artifacts:
                    - key:
                        artifact_type: layout_release
                        artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                      repo: SELF
                    job_tracking_id: 0586160f-c226-46ae-bf19-a50a0c7ae420
                    progress_url: /api/job_tracking/0586160f-c226-46ae-bf19-a50a0c7ae420
                    summary: 'OK: Started background import'
                  summary: Importing one Release Artifact
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomError'
              examples:
                InvalidPayloadJSONStructure:
                  value:
                    error:
                      summary: Failed to deserialize the input payload.
                      details:
                      - loc:
                        - artifacts
                        - 0
                        - artifact_type
                        msg: field required
                        type: value_error.missing
                  summary: Invalid payload JSON structure
                OneOrMoreArtifactsFailedToResolve:
                  value:
                    error:
                      summary: Failed to resolve Artifacts
                      unresolved_artifacts:
                      - artifact_type: layout_release
                        artifact_uuid: 4f0ec35f-c9ca-4dad-8460-bb6797429ea4
                  summary: One or more Artifacts failed to resolve
          description: ''
  /api/v5/artifacts/repo_manifest.json:
    get:
      operationId: repo_manifest.json_retrieve
      description: Produces a file-download response named `repo_manifest.json`. The
        file contains a list of Artifact metadata for all Artifacts available on this
        instance. For the schema of the JSON content, please refer to `ArtifactsRepoManifest`.
      summary: File download endpoint. Provides a list with all Artifacts available
        on the instance
      tags:
      - repo_manifest.json
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsRepoManifest'
              examples:
                SampleRepoManifest.json,ContainingASingleArtifact:
                  value:
                    artifacts:
                    - key:
                        artifact_type: block
                        artifact_uuid: 055f7f4c-5408-4f71-9d8c-895bec100d32
                      description: DISTRIBUTE_TO_STRUCTURED_DOCUMENTS simple block
                      location: /api/artifacts/block/055f7f4c-5408-4f71-9d8c-895bec100d32/download
                      content_type: application/zip
                  summary: Sample repo_manifest.json, containing a single Artifact
          description: ''
  /api/v5/artifacts/repositories:
    get:
      operationId: repositories_list
      description: Lists all available `ArtifactsRepository` objects. Formally, this
        endpoint is paginated, but in practice all objects will always be listed on
        the first page.
      summary: List `ArtifactsRepository` objects
      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      tags:
      - repositories
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedArtifactsRepositoryList'
          description: ''
    post:
      operationId: repositories_create
      description: Persists a new `ArtifactsRepository` object in DB
      summary: Create an `ArtifactsRepository` object
      tags:
      - repositories
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArtifactsRepository'
            examples:
              CreateANewHTTP-typeArtifactsRepository:
                value:
                  name: Internal HS Instance
                  repo_type: HTTP
                  config:
                    manifest_url: http://hsapp01.internal.com/api/v5/artifacts/repo_manifest.json
                    headers:
                      Authorization: Bearer a22d533ebaa60ae5d46b2f0ea67532a4eb8e33be
                summary: Create a new HTTP-type ArtifactsRepository
              CreateANew(disabled)LOCALZIPS-typeArtifactsRepository:
                value:
                  name: Local-folder ArtifactsRepo
                  enabled: false
                  repo_type: LOCAL_ZIPS
                  config:
                    local_folder: /var/www/forms/forms/media/artifacts
                summary: Create a new (disabled) LOCAL_ZIPS-type ArtifactsRepository
              CreateANewS3ZIPS-typeArtifactsRepository:
                value:
                  name: S3 Bucket ArtifactsRepo
                  enabled: true
                  repo_type: S3_ZIPS
                  config:
                    s3_path: s3://some-bucket/some-prefix
                    s3_region: us-east-1
                summary: Create a new S3_ZIPS-type ArtifactsRepository
              CreateANewGCSZIPS-typeArtifactsRepository:
                value:
                  name: GCS Bucket ArtifactsRepo
                  enabled: true
                  repo_type: GCS_ZIPS
                  config:
                    gcs_path: gs://some-bucket/some-prefix
                summary: Create a new GCS_ZIPS-type ArtifactsRepository
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsRepository'
              examples:
                CreatedANewS3ZIPS-typeArtifactsRepository:
                  value:
                    id: 1
                    name: S3 Bucket ArtifactsRepo
                    enabled: true
                    repo_type: S3_ZIPS
                    config:
                      s3_path: s3://some-bucket/some-prefix
                      s3_region: us-east-1
                  summary: Created a new S3_ZIPS-type ArtifactsRepository
                CreatedANewGCSZIPS-typeArtifactsRepository:
                  value:
                    id: 1
                    name: GCS Bucket ArtifactsRepo
                    enabled: true
                    repo_type: GCS_ZIPS
                    config:
                      gcs_path: gs://some-bucket/some-prefix
                  summary: Created a new GCS_ZIPS-type ArtifactsRepository
          description: ''
  /api/v5/artifacts/repositories/{id}:
    get:
      operationId: repositories_retrieve
      description: CRUD ViewSet for `ArtifactsRepository` entities
      summary: Retrieve details for an `ArtifactsRepository` object
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this artifacts repository.
        required: true
      tags:
      - repositories
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsRepository'
          description: ''
    put:
      operationId: repositories_update
      description: CRUD ViewSet for `ArtifactsRepository` entities
      summary: Fully update (replace) an `ArtifactsRepository` object
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this artifacts repository.
        required: true
      tags:
      - repositories
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArtifactsRepository'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ArtifactsRepository'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ArtifactsRepository'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsRepository'
          description: ''
    patch:
      operationId: repositories_partial_update
      description: CRUD ViewSet for `ArtifactsRepository` entities
      summary: Partially update (patch) an `ArtifactsRepository` object
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this artifacts repository.
        required: true
      tags:
      - repositories
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedArtifactsRepository'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedArtifactsRepository'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedArtifactsRepository'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsRepository'
          description: ''
    delete:
      operationId: repositories_destroy
      description: CRUD ViewSet for `ArtifactsRepository` entities
      summary: Delete an `ArtifactsRepository` object
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this artifacts repository.
        required: true
      tags:
      - repositories
      responses:
        '204':
          description: No response body
components:
  schemas:
    AdHocRepository:
      description: |-
        A transient counterpart to the ArtifactsRepository Django model.
        Allows for a Repo to be defined only for the scope of a single operation, without leaving a
        persistent trace on the target system.
      properties:
        name:
          description: Human-friendly Repository name
          title: Name
          type: string
        repo_type:
          description: |-
            The type of the artifacts Repository. Possible choices are:
            - HTTP
            - LOCAL_ZIPS
            - S3_ZIPS
            - GCS_ZIPS
          title: Repo Type
          type: string
        config:
          $ref: '#/components/schemas/RepositoryConfig'
          description: Repository access config
      required:
      - name
      - repo_type
      - config
      title: AdHocRepository
      type: object
    ArtifactKey:
      description: |-
        This is the unique identifier of an Artifact. It is a pair of:
        * `artifact_type` (effectively a string)
        * `artifact_uuid` (an UUID)

        May contain an optional human-friendly description.
      properties:
        artifact_type:
          description: The slug for the Artifact Type - one of the supported values,
            such as `block`, `layout_release`, etc. Together with the Artifact UUID
            they uniquely identify every Artifact.
          title: Artifact Type
          type: string
        artifact_uuid:
          description: The UUID of the Artifact. Together with the Artifact Type they
            uniquely identify every Artifact.
          format: uuid
          title: Artifact Uuid
          type: string
        description:
          anyOf:
          - type: string
          - type: 'null'
          default: null
          description: Optional human-friendly description. Has no functional impact
          title: Description
      required:
      - artifact_type
      - artifact_uuid
      title: ArtifactKey
      type: object
    ArtifactMetadata:
      description: More detailed Artifact metadata, provided by ArtifactsManager's
        and Repositories
      properties:
        key:
          $ref: '#/components/schemas/ArtifactKey'
        description:
          title: Description
          type: string
        location:
          title: Location
          type: string
        content_type:
          title: Content Type
          type: string
      required:
      - key
      - description
      - location
      - content_type
      title: ArtifactMetadata
      type: object
    ArtifactsExportResponse:
      type: object
      properties:
        resolved_artifacts:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
          description: A list with resolution details about every processed Artifact,
            includingthe name of the Repo, where the Artifact was located.
        job_tracking_id:
          type: string
          format: uuid
          description: Reference ID for the long-running async processing job.
        progress_url:
          type: string
          readOnly: true
          description: The URL for monitoring the progress of the async processing
            job.
        summary:
          type: string
          readOnly: true
          default: 'OK: Started background export'
          description: Operation status summary.
        zip_location:
          type: string
          description: The final .ZIP file location - the original one or an auto-generated
            one.
      required:
      - job_tracking_id
      - progress_url
      - resolved_artifacts
      - summary
      - zip_location
    ArtifactsImportResponse:
      type: object
      properties:
        resolved_artifacts:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
          description: A list with resolution details about every processed Artifact,
            includingthe name of the Repo, where the Artifact was located.
        job_tracking_id:
          type: string
          format: uuid
          description: Reference ID for the long-running async processing job.
        progress_url:
          type: string
          readOnly: true
          description: The URL for monitoring the progress of the async processing
            job.
        summary:
          type: string
          readOnly: true
          default: 'OK: Started background import'
          description: Operation status summary.
      required:
      - job_tracking_id
      - progress_url
      - resolved_artifacts
      - summary
    ArtifactsList:
      description: |-
        A liteweight descriptor that defines a list of Artifacts.
        Most commonly, it represents a top-level Artifact with all the Artifacts it depends on,
        traversed transitively.

        During import, the Artifacts are processed in the exact specified order, i.e. it's the
        responsibility of the "producer" of the ArtifactsList to handle dependencies.

        In addition to the Artifacts themselves, there's an optional section that allows for ad-hoc
        repositories to be defined.
      properties:
        repositories:
          default: []
          items:
            $ref: '#/components/schemas/AdHocRepository'
          title: Repositories
          type: array
        artifacts:
          items:
            $ref: '#/components/schemas/ArtifactKey'
          title: Artifacts
          type: array
      required:
      - artifacts
      title: ArtifactsList
      type: object
    ArtifactsNotResolvedResponse:
      type: object
      properties:
        summary:
          type: string
          readOnly: true
          default: Failed to resolve Artifacts
          description: Operation status summary.
        unresolved_artifacts:
          type: array
          items:
            $ref: '#/components/schemas/ArtifactKey'
          description: A list with the ArtifactKeys that failed to resolve
      required:
      - summary
      - unresolved_artifacts
    ArtifactsRepoManifest:
      description: Contains a list of ArtifactMetadata items, for all Artifacts in
        the Repo
      properties:
        artifacts:
          items:
            $ref: '#/components/schemas/ArtifactMetadata'
          title: Artifacts
          type: array
      required:
      - artifacts
      title: ArtifactsRepoManifest
      type: object
    ArtifactsRepository:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Human-friendly Repository name
          maxLength: 256
        enabled:
          type: boolean
          description: Only enabled Repositories are used for artifacts retrieval
        repo_type:
          allOf:
          - $ref: '#/components/schemas/RepoTypeEnum'
          description: |-
            The type of the artifacts Repository. Possible choices are:
            - HTTP
            - LOCAL_ZIPS
            - S3_ZIPS
            - GCS_ZIPS

            * `HTTP` - HTTP
            * `LOCAL_ZIPS` - Local folder with ZIPs
            * `S3_ZIPS` - S3 bucket with ZIPs
            * `GCS_ZIPS` - GCS bucket with ZIPs
        config:
          default: {}
      required:
      - id
      - name
      - repo_type
    CustomError:
      type: object
      properties:
        detail:
          type: string
        status:
          type: integer
        code:
          type: string
        errors:
          $ref: '#/components/schemas/ArtifactsNotResolvedResponse'
      required:
      - code
      - detail
      - errors
      - status
    Error:
      type: object
      description: |-
        Declares the format of error responses.

        Useful for documenting error responses in OpenAPI schemas.
      properties:
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of
            the problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server for this
            occurrence of the problem.
        code:
          type: string
          description: A machine-readable string that provides a specific, stable
            identifier for the error type, allowing clients to distinguish between
            different occurrences of the same HTTP status.
        errors:
          type: object
          additionalProperties: {}
          description: 'An object containing field-level and non-field-level error
            details for structured errors. For validation errors, the value is recursive:
            each level contains an arbitrary set of field names, where each field
            maps to either a list of string error messages or another nested object
            with the same schema. At any level, "non_field_errors" can appear for
            errors not tied to a specific field. This is DRF''s native error structure.'
      required:
      - code
      - detail
      - status
    ExportArtifactsPayload:
      description: |-
        Export operations need both an ArtifactsList
        and a `destination` - either a local or an S3 path or GCS path.
        If the destination is S3, an optional S3 region can be provided.
      properties:
        artifacts_list:
          $ref: '#/components/schemas/ArtifactsList'
        storage_type:
          $ref: '#/components/schemas/ExportStorageType'
        destination:
          title: Destination
          type: string
        destination_config:
          anyOf:
          - $ref: '#/components/schemas/S3ExportConfig'
          - type: 'null'
          default: null
      required:
      - artifacts_list
      - storage_type
      - destination
      title: ExportArtifactsPayload
      type: object
    ExportStorageType:
      enum:
      - local
      - s3
      - gcs
      title: ExportStorageType
      type: string
    GCSZIPsRepositoryConfig:
      description: Data model for `GCS_ZIPS` Repositories' configs
      properties:
        gcs_path:
          description: 'Full path to the GCS folder containing the Artifacts ZIP files.
            Example: `gs://some-bucket/some-prefix`'
          title: Gcs Path
          type: string
      required:
      - gcs_path
      title: GCSZIPsRepositoryConfig
      type: object
    HTTPRepositoryConfig:
      description: Data model for `HTTP` Repositories' configs
      properties:
        manifest_url:
          description: 'The URL of the repository''s `repo_manifest.json` file. Example:
            `http://www.example.com/repo_manifest.json`'
          title: Manifest Url
          type: string
        headers:
          additionalProperties:
            type: string
          default: {}
          description: 'An optional dictionary with HTTP headers to be used when communicating
            with the Repo. Typically, these are Auth headers. Example: `{"Authorization":
            "Bearer a22d533ebaa60ae5d46b2f0ea67532a4eb8e33be"}`'
          title: Headers
          type: object
      required:
      - manifest_url
      title: HTTPRepositoryConfig
      type: object
    LocalZIPsRepositoryConfig:
      description: Data model for `LOCAL_ZIPS` Repositories' configs
      properties:
        local_folder:
          description: 'Full path to the local folder containing the Artifacts ZIP
            files. Example: `/var/www/forms/forms/media/artifacts`'
          title: Local Folder
          type: string
      required:
      - local_folder
      title: LocalZIPsRepositoryConfig
      type: object
    PaginatedArtifactsRepositoryList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/ArtifactsRepository'
    PatchedArtifactsRepository:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Human-friendly Repository name
          maxLength: 256
        enabled:
          type: boolean
          description: Only enabled Repositories are used for artifacts retrieval
        repo_type:
          allOf:
          - $ref: '#/components/schemas/RepoTypeEnum'
          description: |-
            The type of the artifacts Repository. Possible choices are:
            - HTTP
            - LOCAL_ZIPS
            - S3_ZIPS
            - GCS_ZIPS

            * `HTTP` - HTTP
            * `LOCAL_ZIPS` - Local folder with ZIPs
            * `S3_ZIPS` - S3 bucket with ZIPs
            * `GCS_ZIPS` - GCS bucket with ZIPs
        config:
          default: {}
    RepoTypeEnum:
      enum:
      - HTTP
      - LOCAL_ZIPS
      - S3_ZIPS
      - GCS_ZIPS
      type: string
      description: |-
        * `HTTP` - HTTP
        * `LOCAL_ZIPS` - Local folder with ZIPs
        * `S3_ZIPS` - S3 bucket with ZIPs
        * `GCS_ZIPS` - GCS bucket with ZIPs
    RepositoryConfig:
      anyOf:
      - $ref: '#/components/schemas/HTTPRepositoryConfig'
      - $ref: '#/components/schemas/LocalZIPsRepositoryConfig'
      - $ref: '#/components/schemas/S3ZIPsRepositoryConfig'
      - $ref: '#/components/schemas/GCSZIPsRepositoryConfig'
    S3ExportConfig:
      properties:
        s3_region:
          anyOf:
          - type: string
          - type: 'null'
          default: null
          title: S3 Region
      title: S3ExportConfig
      type: object
    S3ZIPsRepositoryConfig:
      description: Data model for `S3_ZIPS` Repositories' configs
      properties:
        s3_path:
          description: 'Full path to the S3 folder containing the Artifacts ZIP files.
            Example: `s3://some-bucket/some-prefix`'
          title: S3 Path
          type: string
        s3_region:
          anyOf:
          - type: string
          - type: 'null'
          default: null
          description: 'The AWS region where the S3 bucket is located. If None, the
            region is determined by the AWS environment variables, configuration files,
            or EC2 instance metadata.Example: `us-west-2`'
          title: S3 Region
      required:
      - s3_path
      title: S3ZIPsRepositoryConfig
      type: object
