Class FileUploadRequest.Builder

java.lang.Object
ai.vectros.resources.documents.requests.FileUploadRequest.Builder
All Implemented Interfaces:
FileUploadRequest._FinalStage, FileUploadRequest.FileNameStage, FileUploadRequest.FileTypeStage
Enclosing class:
FileUploadRequest

public static final class FileUploadRequest.Builder extends Object implements FileUploadRequest.FileNameStage, FileUploadRequest.FileTypeStage, FileUploadRequest._FinalStage
  • Method Details

    • from

      Specified by:
      from in interface FileUploadRequest.FileNameStage
    • fileName

      public FileUploadRequest.FileTypeStage fileName(@NotNull @NotNull String fileName)

      Original file name, including its extension. Used as the document title when no separate title is provided.

      Original file name, including its extension. Used as the document title when no separate title is provided.

      Specified by:
      fileName in interface FileUploadRequest.FileNameStage
      Returns:
      Reference to this so that method calls can be chained together.
    • fileType

      public FileUploadRequest._FinalStage fileType(@NotNull @NotNull String fileType)

      MIME type of the file being uploaded. Used to set the correct Content-Type on the stored object.

      MIME type of the file being uploaded. Used to set the correct Content-Type on the stored object.

      Specified by:
      fileType in interface FileUploadRequest.FileTypeStage
      Returns:
      Reference to this so that method calls can be chained together.
    • externalId

      public FileUploadRequest._FinalStage externalId(String externalId)

      Stable, caller-supplied identifier for this document. Optional. Immutable after create. Unique within your account and context: initiating an upload again with the same externalId returns the same document plus a fresh presigned URL (idempotent — no duplicate), and it is the key other records use to reference this one. Max 256 characters.

      Specified by:
      externalId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • externalId

      public FileUploadRequest._FinalStage externalId(Optional<String> externalId)

      Stable, caller-supplied identifier for this document. Optional. Immutable after create. Unique within your account and context: initiating an upload again with the same externalId returns the same document plus a fresh presigned URL (idempotent — no duplicate), and it is the key other records use to reference this one. Max 256 characters.

      Specified by:
      externalId in interface FileUploadRequest._FinalStage
    • clientId

      public FileUploadRequest._FinalStage clientId(String clientId)

      Associated client ID — the Vectros-assigned UUID of a client in your account. Optional. With an API key, sets the document's client explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      clientId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • clientId

      public FileUploadRequest._FinalStage clientId(Optional<String> clientId)

      Associated client ID — the Vectros-assigned UUID of a client in your account. Optional. With an API key, sets the document's client explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      clientId in interface FileUploadRequest._FinalStage
    • orgId

      public FileUploadRequest._FinalStage orgId(String orgId)

      Owning organization ID — the Vectros-assigned UUID of an organization in your account. Optional. With an API key, sets the document's owning organization explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      orgId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • orgId

      Owning organization ID — the Vectros-assigned UUID of an organization in your account. Optional. With an API key, sets the document's owning organization explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      orgId in interface FileUploadRequest._FinalStage
    • userId

      public FileUploadRequest._FinalStage userId(String userId)

      Owning user ID — the Vectros-assigned UUID of a user in your account. Optional. With an API key, sets the document's owner explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      userId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • userId

      Owning user ID — the Vectros-assigned UUID of a user in your account. Optional. With an API key, sets the document's owner explicitly. With a scoped token, must match the token's identity claim (if set) or fall within its data scope.

      Specified by:
      userId in interface FileUploadRequest._FinalStage
    • schemaId

      public FileUploadRequest._FinalStage schemaId(String schemaId)

      Optional ID of a record schema to bind this document to. When set, the document's payload is validated against the schema and its lookup fields become directly queryable (matching record and text-ingest behavior).

      Specified by:
      schemaId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • schemaId

      public FileUploadRequest._FinalStage schemaId(Optional<String> schemaId)

      Optional ID of a record schema to bind this document to. When set, the document's payload is validated against the schema and its lookup fields become directly queryable (matching record and text-ingest behavior).

      Specified by:
      schemaId in interface FileUploadRequest._FinalStage
    • payload

      public FileUploadRequest._FinalStage payload(Map<String,Object> payload)

      The document's structured data, as a flat key/value object. When schemaId is set, declared fields are validated against the schema and its lookup fields become directly queryable (matching record and text-ingest behavior); undeclared keys pass through as free-form and are searchable via the filters parameter on POST /v1/search.

      Specified by:
      payload in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • payload

      The document's structured data, as a flat key/value object. When schemaId is set, declared fields are validated against the schema and its lookup fields become directly queryable (matching record and text-ingest behavior); undeclared keys pass through as free-form and are searchable via the filters parameter on POST /v1/search.

      Specified by:
      payload in interface FileUploadRequest._FinalStage
    • folderId

      public FileUploadRequest._FinalStage folderId(String folderId)

      ID of the folder in which to place this document. Omit to use your account's default root folder.

      Specified by:
      folderId in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • folderId

      public FileUploadRequest._FinalStage folderId(Optional<String> folderId)

      ID of the folder in which to place this document. Omit to use your account's default root folder.

      Specified by:
      folderId in interface FileUploadRequest._FinalStage
    • indexMode

      Indexing strategy applied after the file is processed and its text is extracted. HYBRID runs both BM25 keyword and dense-vector semantic indexing (recommended). SEMANTIC indexes only as dense vectors. TEXT indexes only with BM25. NONE is store-only (archival): the file is still uploaded and its text extracted, but it is not search-indexed — retrievable by id/download and structured-field lookup only. Optional: omit to inherit the bound schema's default index mode. If neither this field nor the schema specifies one, the request is rejected. When both are set, this per-file value wins.

      Specified by:
      indexMode in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • indexMode

      Indexing strategy applied after the file is processed and its text is extracted. HYBRID runs both BM25 keyword and dense-vector semantic indexing (recommended). SEMANTIC indexes only as dense vectors. TEXT indexes only with BM25. NONE is store-only (archival): the file is still uploaded and its text extracted, but it is not search-indexed — retrievable by id/download and structured-field lookup only. Optional: omit to inherit the bound schema's default index mode. If neither this field nor the schema specifies one, the request is rejected. When both are set, this per-file value wins.

      Specified by:
      indexMode in interface FileUploadRequest._FinalStage
    • upsert

      public FileUploadRequest._FinalStage upsert(Boolean upsert)

      When true and a document with the same externalId already exists, apply the submitted payload/title to that existing document (a metadata upsert) before re-issuing the presigned URL. The file body is replaced inherently by the re-upload; it cannot be diffed at upload-init. Defaults to false. Requires the documents:u scope in addition to documents:c.

      Specified by:
      upsert in interface FileUploadRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • upsert

      When true and a document with the same externalId already exists, apply the submitted payload/title to that existing document (a metadata upsert) before re-issuing the presigned URL. The file body is replaced inherently by the re-upload; it cannot be diffed at upload-init. Defaults to false. Requires the documents:u scope in addition to documents:c.

      Specified by:
      upsert in interface FileUploadRequest._FinalStage
    • build

      public FileUploadRequest build()
      Specified by:
      build in interface FileUploadRequest._FinalStage
    • additionalProperty

      public FileUploadRequest.Builder additionalProperty(String key, Object value)
      Specified by:
      additionalProperty in interface FileUploadRequest._FinalStage
    • additionalProperties

      public FileUploadRequest.Builder additionalProperties(Map<String,Object> additionalProperties)
      Specified by:
      additionalProperties in interface FileUploadRequest._FinalStage