Class DocumentRequest.Builder

java.lang.Object
ai.vectros.types.DocumentRequest.Builder
All Implemented Interfaces:
DocumentRequest._FinalStage, DocumentRequest.TitleStage
Enclosing class:
DocumentRequest

public static final class DocumentRequest.Builder extends Object implements DocumentRequest.TitleStage, DocumentRequest._FinalStage
  • Method Details

    • from

      Specified by:
      from in interface DocumentRequest.TitleStage
    • title

      public DocumentRequest._FinalStage title(@NotNull @NotNull String title)

      Human-readable document title

      Human-readable document title

      Specified by:
      title in interface DocumentRequest.TitleStage
      Returns:
      Reference to this so that method calls can be chained together.
    • status

      Caller-controlled lifecycle status. ACTIVE (the default) keeps the document live and searchable; ARCHIVED soft-retracts it — the document is pulled from search/recall but kept and recoverable (set it back to ACTIVE to re-index and restore). Use this to retire superseded content without deleting it. On update, omit to leave the current lifecycle status unchanged. Distinct from the read-only indexStatus (the processing pipeline).

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

      Caller-controlled lifecycle status. ACTIVE (the default) keeps the document live and searchable; ARCHIVED soft-retracts it — the document is pulled from search/recall but kept and recoverable (set it back to ACTIVE to re-index and restore). Use this to retire superseded content without deleting it. On update, omit to leave the current lifecycle status unchanged. Distinct from the read-only indexStatus (the processing pipeline).

      Specified by:
      status in interface DocumentRequest._FinalStage
    • expectedVersion

      public DocumentRequest._FinalStage expectedVersion(Long expectedVersion)

      Optimistic-concurrency token. Pass the version you last read (from a GET or a prior write response) to make this update conditional — it is rejected with 409 VERSION_CONFLICT if the document was modified since, leaving the stored document untouched. Omit for last-write-wins (the default). Ignored on create.

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

      public DocumentRequest._FinalStage expectedVersion(Optional<Long> expectedVersion)

      Optimistic-concurrency token. Pass the version you last read (from a GET or a prior write response) to make this update conditional — it is rejected with 409 VERSION_CONFLICT if the document was modified since, leaving the stored document untouched. Omit for last-write-wins (the default). Ignored on create.

      Specified by:
      expectedVersion in interface DocumentRequest._FinalStage
    • externalId

      public DocumentRequest._FinalStage externalId(String externalId)

      Stable, caller-supplied identifier for this document. Optional. Immutable after create. Unique within your account and context: posting again with the same externalId returns the existing document (idempotent ingest), and it is the key other records use to reference this one. Max 256 characters.

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

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

      Stable, caller-supplied identifier for this document. Optional. Immutable after create. Unique within your account and context: posting again with the same externalId returns the existing document (idempotent ingest), and it is the key other records use to reference this one. Max 256 characters.

      Specified by:
      externalId in interface DocumentRequest._FinalStage
    • scopes

      public DocumentRequest._FinalStage scopes(List<String> scopes)

      The document's scope ownership, as namespace:value entries (at most 2 namespaces) — for example ["org:6ba7b810-9dad-11d1-80b4-00c04fd430c8", "group:eng-team"]. org and client are built-in namespaces; others are custom scopes you define (lowercase, 2-32 chars). Resolve a namespace's UUID from your own identifier with GET /v1/entities/{namespace}?externalId=. When supplied, this is the document's COMPLETE scope declaration: for a token that stamps identity, entries must match the token's identity values, and an empty array creates a document owned by the calling user alone (the private tier). Omit the field to inherit the token's full identity — the default. On update, omit to leave ownership unchanged, or supply the complete new selection ([] clears it). Filter lists by these values with ?scope=.

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

      public DocumentRequest._FinalStage scopes(Optional<List<String>> scopes)

      The document's scope ownership, as namespace:value entries (at most 2 namespaces) — for example ["org:6ba7b810-9dad-11d1-80b4-00c04fd430c8", "group:eng-team"]. org and client are built-in namespaces; others are custom scopes you define (lowercase, 2-32 chars). Resolve a namespace's UUID from your own identifier with GET /v1/entities/{namespace}?externalId=. When supplied, this is the document's COMPLETE scope declaration: for a token that stamps identity, entries must match the token's identity values, and an empty array creates a document owned by the calling user alone (the private tier). Omit the field to inherit the token's full identity — the default. On update, omit to leave ownership unchanged, or supply the complete new selection ([] clears it). Filter lists by these values with ?scope=.

      Specified by:
      scopes in interface DocumentRequest._FinalStage
    • userId

      public DocumentRequest._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 DocumentRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • userId

      public DocumentRequest._FinalStage userId(Optional<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 DocumentRequest._FinalStage
    • schemaId

      public DocumentRequest._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's fields on save, and the schema's lookup fields become directly queryable (the same behavior as records). On update, omit to leave unchanged.

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

      public DocumentRequest._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's fields on save, and the schema's lookup fields become directly queryable (the same behavior as records). On update, omit to leave unchanged.

      Specified by:
      schemaId in interface DocumentRequest._FinalStage
    • payload

      public DocumentRequest._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 via GET /v1/documents?type=&field=&value= (sensitive fields are blind-indexed); undeclared keys pass through as free-form and are searchable via the filters parameter on POST /v1/search. A strict schema rejects undeclared keys. On update, the supplied object replaces the stored payload in full (it is not key-merged); omit to leave it unchanged.

      Specified by:
      payload in interface DocumentRequest._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 via GET /v1/documents?type=&field=&value= (sensitive fields are blind-indexed); undeclared keys pass through as free-form and are searchable via the filters parameter on POST /v1/search. A strict schema rejects undeclared keys. On update, the supplied object replaces the stored payload in full (it is not key-merged); omit to leave it unchanged.

      Specified by:
      payload in interface DocumentRequest._FinalStage
    • folderId

      public DocumentRequest._FinalStage folderId(String folderId)

      ID of the folder to place this document in. On create, omit to use your account's default root folder. On update, omit to leave unchanged — this field cannot currently be cleared once set.

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

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

      ID of the folder to place this document in. On create, omit to use your account's default root folder. On update, omit to leave unchanged — this field cannot currently be cleared once set.

      Specified by:
      folderId in interface DocumentRequest._FinalStage
    • indexMode

      Indexing strategy for this document. HYBRID runs both BM25 keyword and dense-vector semantic indexing (recommended for most use cases). SEMANTIC indexes only as dense vectors — best for conceptual similarity search. TEXT indexes only with BM25 — best for exact keyword matching. NONE stores the document without search indexing (store-only / archival): it remains retrievable by id and by structured-field lookup but never appears in search results. 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-document value wins.

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

      Indexing strategy for this document. HYBRID runs both BM25 keyword and dense-vector semantic indexing (recommended for most use cases). SEMANTIC indexes only as dense vectors — best for conceptual similarity search. TEXT indexes only with BM25 — best for exact keyword matching. NONE stores the document without search indexing (store-only / archival): it remains retrievable by id and by structured-field lookup but never appears in search results. 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-document value wins.

      Specified by:
      indexMode in interface DocumentRequest._FinalStage
    • text

      public DocumentRequest._FinalStage text(String text)

      Raw text content to ingest. Required when creating a document via the text-ingest path. On update, supply it to replace the stored text; omit it to leave the existing text unchanged.

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

      Raw text content to ingest. Required when creating a document via the text-ingest path. On update, supply it to replace the stored text; omit it to leave the existing text unchanged.

      Specified by:
      text in interface DocumentRequest._FinalStage
    • build

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

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

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