Class Document.Builder

java.lang.Object
com.google.genai.types.Document.Builder
Enclosing class:
Document

public abstract static class Document.Builder extends Object
Builder for Document.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public abstract Document.Builder name(String name)
      Setter for name.

      name: Immutable. Identifier. The `Document` resource name. The ID (name excluding the "fileSearchStores/*/documents/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`

    • clearName

      @CanIgnoreReturnValue public Document.Builder clearName()
      Clears the value of name field.
    • displayName

      public abstract Document.Builder displayName(String displayName)
      Setter for displayName.

      displayName: Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation".

    • clearDisplayName

      @CanIgnoreReturnValue public Document.Builder clearDisplayName()
      Clears the value of displayName field.
    • state

      public abstract Document.Builder state(DocumentState state)
      Setter for state.

      state: Output only. Current state of the `Document`.

    • clearState

      @CanIgnoreReturnValue public Document.Builder clearState()
      Clears the value of state field.
    • state

      @CanIgnoreReturnValue public Document.Builder state(DocumentState.Known knownType)
      Setter for state given a known enum.

      state: Output only. Current state of the `Document`.

    • state

      @CanIgnoreReturnValue public Document.Builder state(String state)
      Setter for state given a string.

      state: Output only. Current state of the `Document`.

    • sizeBytes

      public abstract Document.Builder sizeBytes(Long sizeBytes)
      Setter for sizeBytes.

      sizeBytes: Output only. The size of raw bytes ingested into the Document.

    • clearSizeBytes

      @CanIgnoreReturnValue public Document.Builder clearSizeBytes()
      Clears the value of sizeBytes field.
    • mimeType

      public abstract Document.Builder mimeType(String mimeType)
      Setter for mimeType.

      mimeType: Output only. The mime type of the Document.

    • clearMimeType

      @CanIgnoreReturnValue public Document.Builder clearMimeType()
      Clears the value of mimeType field.
    • createTime

      public abstract Document.Builder createTime(Instant createTime)
      Setter for createTime.

      createTime: Output only. The Timestamp of when the `Document` was created.

    • clearCreateTime

      @CanIgnoreReturnValue public Document.Builder clearCreateTime()
      Clears the value of createTime field.
    • customMetadata

      public abstract Document.Builder customMetadata(List<CustomMetadata> customMetadata)
      Setter for customMetadata.

      customMetadata: Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.

    • customMetadata

      @CanIgnoreReturnValue public Document.Builder customMetadata(CustomMetadata... customMetadata)
      Setter for customMetadata.

      customMetadata: Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.

    • customMetadata

      @CanIgnoreReturnValue public Document.Builder customMetadata(CustomMetadata.Builder... customMetadataBuilders)
      Setter for customMetadata builder.

      customMetadata: Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.

    • clearCustomMetadata

      @CanIgnoreReturnValue public Document.Builder clearCustomMetadata()
      Clears the value of customMetadata field.
    • updateTime

      public abstract Document.Builder updateTime(Instant updateTime)
      Setter for updateTime.

      updateTime: Output only. The Timestamp of when the `Document` was last updated.

    • clearUpdateTime

      @CanIgnoreReturnValue public Document.Builder clearUpdateTime()
      Clears the value of updateTime field.
    • build

      public abstract Document build()