Class File.Builder
- java.lang.Object
-
- ai.extend.types.File.Builder
-
- All Implemented Interfaces:
File._FinalStage,File.CreatedAtStage,File.IdStage,File.MetadataStage,File.NameStage,File.UpdatedAtStage
- Enclosing class:
- File
public static final class File.Builder extends java.lang.Object implements File.IdStage, File.NameStage, File.MetadataStage, File.CreatedAtStage, File.UpdatedAtStage, File._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filebuild()File._FinalStagecontents(Nullable<FileContents> contents)Deprecated: Use thePOST /parse_runsendpoint instead to parse and retrieve file contents.File._FinalStagecontents(FileContents contents)Deprecated: Use thePOST /parse_runsendpoint instead to parse and retrieve file contents.File._FinalStagecontents(java.util.Optional<FileContents> contents)Deprecated: Use thePOST /parse_runsendpoint instead to parse and retrieve file contents.File.UpdatedAtStagecreatedAt(java.time.OffsetDateTime createdAt)File.Builderfrom(File other)File.NameStageid(java.lang.String id)ID for the file.File.CreatedAtStagemetadata(FileMetadata metadata)File.MetadataStagename(java.lang.String name)The name of the fileFile._FinalStageparentFileId(Nullable<java.lang.String> parentFileId)ID of the parent file.File._FinalStageparentFileId(java.lang.String parentFileId)ID of the parent file.File._FinalStageparentFileId(java.util.Optional<java.lang.String> parentFileId)ID of the parent file.File._FinalStagepresignedUrl(Nullable<java.lang.String> presignedUrl)A presigned URL to download the file.File._FinalStagepresignedUrl(java.lang.String presignedUrl)A presigned URL to download the file.File._FinalStagepresignedUrl(java.util.Optional<java.lang.String> presignedUrl)A presigned URL to download the file.File._FinalStagetype(Nullable<FileType> type)The type of the file.File._FinalStagetype(FileType type)The type of the file.File._FinalStagetype(java.util.Optional<FileType> type)The type of the file.File._FinalStageupdatedAt(java.time.OffsetDateTime updatedAt)
-
-
-
Method Detail
-
from
public File.Builder from(File other)
- Specified by:
fromin interfaceFile.IdStage
-
id
public File.NameStage id(@NotNull java.lang.String id)
ID for the file.
Example:
"file_xK9mLPqRtN3vS8wF5hB2cQ"ID for the file.
Example:
"file_xK9mLPqRtN3vS8wF5hB2cQ"- Specified by:
idin interfaceFile.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
name
public File.MetadataStage name(@NotNull java.lang.String name)
The name of the file
Example:
"Invoices.pdf"The name of the file
Example:
"Invoices.pdf"- Specified by:
namein interfaceFile.NameStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public File.CreatedAtStage metadata(@NotNull FileMetadata metadata)
- Specified by:
metadatain interfaceFile.MetadataStage
-
createdAt
public File.UpdatedAtStage createdAt(@NotNull java.time.OffsetDateTime createdAt)
- Specified by:
createdAtin interfaceFile.CreatedAtStage
-
updatedAt
public File._FinalStage updatedAt(@NotNull java.time.OffsetDateTime updatedAt)
- Specified by:
updatedAtin interfaceFile.UpdatedAtStage
-
contents
public File._FinalStage contents(Nullable<FileContents> contents)
Deprecated: Use the
POST /parse_runsendpoint instead to parse and retrieve file contents. The parse runs endpoint provides more control over parsing configuration and better performance.The parsed content of the file. This field will only contain data after the file has been parsed via a parse run, extract run, classify run, split run, edit run, or workflow run.
Availability: Only present and populated on
GET /files/{id}when the file has been previously parsed and the corresponding query parameters are set to true. Will benullonPOST /files/uploadand for files that haven't been parsed. The structure varies based on file type.- Specified by:
contentsin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
contents
public File._FinalStage contents(FileContents contents)
Deprecated: Use the
POST /parse_runsendpoint instead to parse and retrieve file contents. The parse runs endpoint provides more control over parsing configuration and better performance.The parsed content of the file. This field will only contain data after the file has been parsed via a parse run, extract run, classify run, split run, edit run, or workflow run.
Availability: Only present and populated on
GET /files/{id}when the file has been previously parsed and the corresponding query parameters are set to true. Will benullonPOST /files/uploadand for files that haven't been parsed. The structure varies based on file type.- Specified by:
contentsin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
contents
public File._FinalStage contents(java.util.Optional<FileContents> contents)
Deprecated: Use the
POST /parse_runsendpoint instead to parse and retrieve file contents. The parse runs endpoint provides more control over parsing configuration and better performance.The parsed content of the file. This field will only contain data after the file has been parsed via a parse run, extract run, classify run, split run, edit run, or workflow run.
Availability: Only present and populated on
GET /files/{id}when the file has been previously parsed and the corresponding query parameters are set to true. Will benullonPOST /files/uploadand for files that haven't been parsed. The structure varies based on file type.- Specified by:
contentsin interfaceFile._FinalStage
-
parentFileId
public File._FinalStage parentFileId(Nullable<java.lang.String> parentFileId)
ID of the parent file.
Availability: Present for files created via a Splitter in a workflow.
- Specified by:
parentFileIdin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
parentFileId
public File._FinalStage parentFileId(java.lang.String parentFileId)
ID of the parent file.
Availability: Present for files created via a Splitter in a workflow.
- Specified by:
parentFileIdin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
parentFileId
public File._FinalStage parentFileId(java.util.Optional<java.lang.String> parentFileId)
ID of the parent file.
Availability: Present for files created via a Splitter in a workflow.
- Specified by:
parentFileIdin interfaceFile._FinalStage
-
presignedUrl
public File._FinalStage presignedUrl(Nullable<java.lang.String> presignedUrl)
A presigned URL to download the file. Expires after 15 minutes.
Availability: Present on
GET /files/{id}. Not present onPOST /files/uploador when the file is embedded in other resources (e.g., in run responses).- Specified by:
presignedUrlin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
presignedUrl
public File._FinalStage presignedUrl(java.lang.String presignedUrl)
A presigned URL to download the file. Expires after 15 minutes.
Availability: Present on
GET /files/{id}. Not present onPOST /files/uploador when the file is embedded in other resources (e.g., in run responses).- Specified by:
presignedUrlin interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
presignedUrl
public File._FinalStage presignedUrl(java.util.Optional<java.lang.String> presignedUrl)
A presigned URL to download the file. Expires after 15 minutes.
Availability: Present on
GET /files/{id}. Not present onPOST /files/uploador when the file is embedded in other resources (e.g., in run responses).- Specified by:
presignedUrlin interfaceFile._FinalStage
-
type
public File._FinalStage type(Nullable<FileType> type)
The type of the file.
Availability: Present when the file type could be determined.
- Specified by:
typein interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
type
public File._FinalStage type(FileType type)
The type of the file.
Availability: Present when the file type could be determined.
- Specified by:
typein interfaceFile._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
type
public File._FinalStage type(java.util.Optional<FileType> type)
The type of the file.
Availability: Present when the file type could be determined.
- Specified by:
typein interfaceFile._FinalStage
-
build
public File build()
- Specified by:
buildin interfaceFile._FinalStage
-
-