Class RecordRequest.Builder

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

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

    • from

      public RecordRequest.Builder from(RecordRequest other)
    • typeName

      public RecordRequest.Builder typeName(Optional<String> typeName)

      The record type, matching a schema's record type. Provide typeName or schemaId (at least one is required); when only schemaId is given, the type is resolved from the schema, and when both are given they must agree. Immutable after creation and ignored on update.

    • typeName

      public RecordRequest.Builder typeName(String typeName)
    • schemaId

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

      Identifier of the schema to validate against. Optional: omit it and the server resolves the schema from typeName (record types are unique within your account and context); supply it (and omit typeName) to pin a schema and resolve the type from it. Provide typeName or schemaId (at least one); when both are given the server checks that they agree. Immutable after creation and ignored on update.

    • schemaId

      public RecordRequest.Builder schemaId(String schemaId)
    • payload

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

      The record's data payload — a JSON object whose structure is validated against the referenced schema. Fields the schema marks as searchable contribute to full-text and semantic search. On update, the supplied object replaces the stored payload in full (it is not key-merged); omit it to leave the payload unchanged.

    • payload

      public RecordRequest.Builder payload(Map<String,Object> payload)
    • status

      Record lifecycle status. ACTIVE (the default) keeps the record live and searchable; ARCHIVED retracts it from search and recall (POST /v1/search and RAG) while keeping it stored, retrievable by id, findable by structured-field lookup, and listed by GET /v1/records — set it back to ACTIVE to re-index and restore. On update, omit to leave the current status unchanged.

    • status

    • folderId

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

      Identifier of the folder to group this record with related documents. On create, omit to leave the record ungrouped. On update, omit to leave it unchanged; once set, this field cannot be cleared.

    • folderId

      public RecordRequest.Builder folderId(String folderId)
    • userId

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

      Identifier of the owning user — the Vectros-assigned UUID of a user in your account. Optional, and may be set automatically from the calling token's identity. Use GET /v1/users?externalId= to resolve the UUID from your own identifier.

    • userId

      public RecordRequest.Builder userId(String userId)
    • scopes

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

      The record'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 reserved namespace names, registered like any other; others are namespaces you registered yourself (lowercase, 2-32 chars). A value is 1-128 characters: a letter or digit first, then letters, digits, _ or -. Resolve a namespace's UUID from your own identifier with GET /v1/entities/{namespace}?externalId=. When supplied, this is the record's COMPLETE scope declaration: each entry must fall inside the data_scope of a single clause of your credential that also grants this write — your identity supplies the DEFAULT value when you state none, it does not limit which value you may state. An empty array creates a row owned by the calling user alone (the private tier), and requires a credential whose identity carries a user. 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=.

    • scopes

      public RecordRequest.Builder scopes(List<String> scopes)
    • externalId

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

      Your own stable identifier for this record. Optional, and immutable after create. Unique within your account, context, and record type: posting again with the same externalId returns the existing record (idempotent create), and it is the key other records reference. Maximum 256 characters.

    • externalId

      public RecordRequest.Builder externalId(String externalId)
    • indexMode

      public RecordRequest.Builder indexMode(Optional<RecordRequestIndexMode> indexMode)

      Per-record override of the search-index mode. HYBRID, SEMANTIC, and TEXT index this record for search; NONE is store-only (persisted, retrievable by id, and findable by structured-field lookup, but not searchable). Optional — omit it to inherit the schema's type-level default index mode (which itself defaults to NONE when the schema declares none). When both are set, this per-record value wins. Immutable after create.

    • indexMode

      public RecordRequest.Builder indexMode(RecordRequestIndexMode indexMode)
    • expiresAt

      public RecordRequest.Builder expiresAt(Optional<String> expiresAt)

      Optional absolute expiry, as an ISO-8601 UTC timestamp. When set, the record is automatically deleted at (or shortly after) this time — removed from search and storage, the same as an explicit delete. Requires the schema to opt in with capabilities.ttlEligible: true (else the request is rejected). Must be at least 10 minutes in the future. Omit to leave the record's expiry unchanged; records have no expiry by default.

    • expiresAt

      public RecordRequest.Builder expiresAt(String expiresAt)
    • expectedVersion

      public RecordRequest.Builder expectedVersion(Optional<Long> expectedVersion)

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

    • expectedVersion

      public RecordRequest.Builder expectedVersion(Long expectedVersion)
    • build

      public RecordRequest build()
    • additionalProperty

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

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