Class File.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • name

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

      name: The `File` resource name. The ID (name excluding the "files/" 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 generated. Example: `files/123-456`

    • displayName

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

      displayName: Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'

    • mimeType

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

      mimeType: Output only. MIME type of the file.

    • sizeBytes

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

      sizeBytes: Output only. Size of the file in bytes.

    • createTime

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

      createTime: Output only. The timestamp of when the `File` was created.

    • expirationTime

      public abstract File.Builder expirationTime(Instant expirationTime)
      Setter for expirationTime.

      expirationTime: Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.

    • updateTime

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

      updateTime: Output only. The timestamp of when the `File` was last updated.

    • sha256Hash

      public abstract File.Builder sha256Hash(String sha256Hash)
      Setter for sha256Hash.

      sha256Hash: Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.

    • uri

      public abstract File.Builder uri(String uri)
      Setter for uri.

      uri: Output only. The URI of the `File`.

    • downloadUri

      public abstract File.Builder downloadUri(String downloadUri)
      Setter for downloadUri.

      downloadUri: Output only. The URI of the `File`, only set for downloadable (generated) files.

    • state

      public abstract File.Builder state(FileState state)
      Setter for state.

      state: Output only. Processing state of the File.

    • state

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

      state: Output only. Processing state of the File.

    • state

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

      state: Output only. Processing state of the File.

    • source

      public abstract File.Builder source(FileSource source)
      Setter for source.

      source: Output only. The source of the `File`.

    • source

      @CanIgnoreReturnValue public File.Builder source(FileSource.Known knownType)
      Setter for source given a known enum.

      source: Output only. The source of the `File`.

    • source

      @CanIgnoreReturnValue public File.Builder source(String source)
      Setter for source given a string.

      source: Output only. The source of the `File`.

    • videoMetadata

      public abstract File.Builder videoMetadata(Map<String,Object> videoMetadata)
      Setter for videoMetadata.

      videoMetadata: Output only. Metadata for a video.

    • error

      public abstract File.Builder error(FileStatus error)
      Setter for error.

      error: Output only. Error status if File processing failed.

    • error

      public File.Builder error(FileStatus.Builder errorBuilder)
      Setter for error builder.

      error: Output only. Error status if File processing failed.

    • build

      public abstract File build()