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`

    • clearName

      @CanIgnoreReturnValue public File.Builder clearName()
      Clears the value of name field.
    • 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'

    • clearDisplayName

      @CanIgnoreReturnValue public File.Builder clearDisplayName()
      Clears the value of displayName field.
    • mimeType

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

      mimeType: Output only. MIME type of the file.

    • clearMimeType

      @CanIgnoreReturnValue public File.Builder clearMimeType()
      Clears the value of mimeType field.
    • sizeBytes

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

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

    • clearSizeBytes

      @CanIgnoreReturnValue public File.Builder clearSizeBytes()
      Clears the value of sizeBytes field.
    • createTime

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

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

    • clearCreateTime

      @CanIgnoreReturnValue public File.Builder clearCreateTime()
      Clears the value of createTime field.
    • 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.

    • clearExpirationTime

      @CanIgnoreReturnValue public File.Builder clearExpirationTime()
      Clears the value of expirationTime field.
    • updateTime

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

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

    • clearUpdateTime

      @CanIgnoreReturnValue public File.Builder clearUpdateTime()
      Clears the value of updateTime field.
    • 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.

    • clearSha256Hash

      @CanIgnoreReturnValue public File.Builder clearSha256Hash()
      Clears the value of sha256Hash field.
    • uri

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

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

    • clearUri

      @CanIgnoreReturnValue public File.Builder clearUri()
      Clears the value of uri field.
    • 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.

    • clearDownloadUri

      @CanIgnoreReturnValue public File.Builder clearDownloadUri()
      Clears the value of downloadUri field.
    • state

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

      state: Output only. Processing state of the File.

    • clearState

      @CanIgnoreReturnValue public File.Builder clearState()
      Clears the value of state field.
    • 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`.

    • clearSource

      @CanIgnoreReturnValue public File.Builder clearSource()
      Clears the value of source field.
    • 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.

    • clearVideoMetadata

      @CanIgnoreReturnValue public File.Builder clearVideoMetadata()
      Clears the value of videoMetadata field.
    • error

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

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

    • error

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

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

    • clearError

      @CanIgnoreReturnValue public File.Builder clearError()
      Clears the value of error field.
    • build

      public abstract File build()