Class DocumentResponse.Builder

java.lang.Object
ai.vectros.types.DocumentResponse.Builder
Enclosing class:
DocumentResponse

public static final class DocumentResponse.Builder extends Object
  • Method Details

    • from

    • created

      public DocumentResponse.Builder created(Optional<Boolean> created)

      Whether this call created a new document. True when a new document was created; false when a document with the same externalId already existed and was returned unchanged (idempotent create) or updated (when ?upsert=true). Present only on the create response (POST /v1/documents); absent on reads. The HTTP status mirrors it — 201 when created, 200 when an existing document was returned.

    • created

      public DocumentResponse.Builder created(Boolean created)
    • id

      The Vectros-assigned unique ID of the document.

    • id

    • title

      public DocumentResponse.Builder title(Optional<String> title)

      The document's title.

    • title

      public DocumentResponse.Builder title(String title)
    • externalId

      public DocumentResponse.Builder externalId(Optional<String> externalId)

      Your own stable identifier for this document (immutable, and unique within your context). Null if the document was created without one.

    • externalId

      public DocumentResponse.Builder externalId(String externalId)
    • status

      Lifecycle status you control. ACTIVE (the default) means the document is live and returned in search/recall; ARCHIVED means you have soft-retracted it — it is pulled from search but kept and recoverable (set it back to ACTIVE to restore). Set via the document update endpoint. Distinct from indexStatus, which reports the processing pipeline.

    • status

    • indexStatus

      Processing status of the document (system-managed, read-only). PENDING_UPLOAD, UPLOADED, EXTRACTING, and PENDING_INDEX are in-flight states; INDEXED means indexing is complete and the document is searchable — but the two search strategies do not become queryable at the same instant. Keyword (TEXT) matching is immediate. The semantic (vector) index is eventually consistent for queries: durably written at INDEXED, but typically queryable a second or two later (longer under heavy indexing load). A freshly indexed document that matches a HYBRID or RAG query's keywords still surfaces immediately — you don't wait for the vector index — but a query that can only match it semantically (a mode: SEMANTIC search, or a HYBRID/RAG query sharing no words with the document) may not return it for those first few seconds. If you search immediately after a write, share words with the document or briefly retry. SKIPPED means extraction produced no indexable text so there was nothing to index — the document is stored and retrievable, just not searchable (not an error); STORED means it is store-only (indexMode=NONE) — persisted and retrievable but by design not searchable; FAILED means processing failed.

    • indexStatus

      public DocumentResponse.Builder indexStatus(DocumentResponseIndexStatus indexStatus)
    • indexFailure

      public DocumentResponse.Builder indexFailure(Optional<IndexFailure> indexFailure)
    • indexFailure

      public DocumentResponse.Builder indexFailure(IndexFailure indexFailure)
    • indexMode

      How this document is indexed. HYBRID, SEMANTIC, and TEXT are searchable; NONE is store-only (not indexed for search).

    • indexMode

    • storeText

      public DocumentResponse.Builder storeText(Optional<Boolean> storeText)

      Whether the document's text is retained after indexing — fixed at ingest time. Text-ingested documents always retain their body. File-uploaded documents retain their extracted text by default; uploaded with storeText=false, the extracted text is discarded once indexing completes (/text then returns 404 and /ask 409; search and the file download are unaffected). Note: documents created before this flag reached its current semantics may report false while their text was in fact retained (file documents from before the flag was settable, and text documents ingested under the old opt-in) — GET /{id}/text succeeding is the authoritative signal for those.

    • storeText

      public DocumentResponse.Builder storeText(Boolean storeText)
    • folderId

      public DocumentResponse.Builder folderId(Optional<String> folderId)

      The ID of the folder that contains this document.

    • folderId

      public DocumentResponse.Builder folderId(String folderId)
    • payload

      public DocumentResponse.Builder payload(Optional<Map<String,Object>> payload)

      The document's structured payload, as a JSON object. When schemaId is set, schema-declared fields are validated and indexed for lookup; undeclared keys pass through as free-form. A by-id GET returns the full payload; on list responses this may be only the inline subset of fields (see payloadExternalized).

    • payload

      public DocumentResponse.Builder payload(Map<String,Object> payload)
    • payloadExternalized

      public DocumentResponse.Builder payloadExternalized(Optional<Boolean> payloadExternalized)

      True when this document's structured payload is large enough to be stored externally rather than inline. In that case payload on a list response holds only the inline subset of fields; fetch the full payload with a by-id GET.

    • payloadExternalized

      public DocumentResponse.Builder payloadExternalized(Boolean payloadExternalized)
    • payloadPartial

      public DocumentResponse.Builder payloadPartial(Optional<Boolean> payloadPartial)

      True when THIS response returned only a PARTIAL structured payload — a large document's bulk fields are omitted from payload because you did not request them (a list or lookup without includePayload=true). Unlike payloadExternalized (also true on a by-id read that DID return the full payload), this tells you the payload in hand is incomplete: fetch the full payload with a by-id GET or includePayload=true. To UPDATE such a document, use PATCH (which preserves omitted fields) — a PUT built from this response would clear them unless you pass ?allowClear=true. Null when the payload is complete. (The document's text/body is always preserved on a PUT that omits text.)

    • payloadPartial

      public DocumentResponse.Builder payloadPartial(Boolean payloadPartial)
    • schemaId

      public DocumentResponse.Builder schemaId(Optional<String> schemaId)

      The ID of the record schema this document's payload is validated and indexed against. Null if the document is schemaless.

    • schemaId

      public DocumentResponse.Builder schemaId(String schemaId)
    • schemaVersion

      public DocumentResponse.Builder schemaVersion(Optional<Integer> schemaVersion)

      The version of the bound schema in effect when this document was written. A document keeps the version it was stamped with at write time, even after the schema is later edited. Null when the document is schemaless.

    • schemaVersion

      public DocumentResponse.Builder schemaVersion(Integer schemaVersion)
    • textBytes

      public DocumentResponse.Builder textBytes(Optional<Long> textBytes)

      Size of the extracted text, in bytes.

    • textBytes

      public DocumentResponse.Builder textBytes(Long textBytes)
    • userId

      public DocumentResponse.Builder userId(Optional<String> userId)

      The owning user — the Vectros-assigned UUID of a user in your account.

    • userId

      public DocumentResponse.Builder userId(String userId)
    • scopes

      public DocumentResponse.Builder scopes(Optional<List<String>> scopes)

      The document's scope ownership as canonical namespace:value entries (at most 2). org and client are reserved namespace names; any other is one you registered yourself. Set at creation, either explicitly or automatically from the calling token's identity. Empty for a document owned by a user alone (or unowned). Filter lists by these values with ?scope=.

    • scopes

      public DocumentResponse.Builder scopes(List<String> scopes)
    • fileType

      public DocumentResponse.Builder fileType(Optional<String> fileType)

      MIME type of the uploaded file. Present only for file-backed documents.

    • fileType

      public DocumentResponse.Builder fileType(String fileType)
    • fileSize

      public DocumentResponse.Builder fileSize(Optional<Long> fileSize)

      Size of the uploaded file, in bytes. Present only for file-backed documents.

    • fileSize

      public DocumentResponse.Builder fileSize(Long fileSize)
    • createdAt

      public DocumentResponse.Builder createdAt(Optional<String> createdAt)

      When the document was created, as an ISO-8601 UTC timestamp.

    • createdAt

      public DocumentResponse.Builder createdAt(String createdAt)
    • lastModified

      public DocumentResponse.Builder lastModified(Optional<String> lastModified)

      When the document was last modified, as an ISO-8601 UTC timestamp.

    • lastModified

      public DocumentResponse.Builder lastModified(String lastModified)
    • version

      public DocumentResponse.Builder version(Optional<Long> version)

      Optimistic-concurrency version. Pass this back as expectedVersion on a later update to avoid silently overwriting a concurrent change — the update is rejected with 409 if the document has moved on. Incremented on every successful write.

    • version

      public DocumentResponse.Builder version(Long version)
    • build

      public DocumentResponse build()
    • additionalProperty

      public DocumentResponse.Builder additionalProperty(String key, Object value)
    • additionalProperties

      public DocumentResponse.Builder additionalProperties(Map<String,Object> additionalProperties)