Class File
- java.lang.Object
-
- ai.extend.types.File
-
public final class File extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFile._FinalStagestatic classFile.Builderstatic interfaceFile.CreatedAtStagestatic interfaceFile.IdStagestatic interfaceFile.MetadataStagestatic interfaceFile.NameStagestatic interfaceFile.UpdatedAtStage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static File.IdStagebuilder()booleanequals(java.lang.Object other)java.util.Map<java.lang.String,java.lang.Object>getAdditionalProperties()java.util.Optional<FileContents>getContents()java.time.OffsetDateTimegetCreatedAt()java.lang.StringgetId()FileMetadatagetMetadata()java.lang.StringgetName()java.lang.StringgetObject()java.util.Optional<java.lang.String>getParentFileId()java.util.Optional<java.lang.String>getPresignedUrl()java.util.Optional<FileType>getType()java.time.OffsetDateTimegetUpdatedAt()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getObject
public java.lang.String getObject()
- Returns:
- The type of object. Will always be
"file".
-
getId
public java.lang.String getId()
- Returns:
- ID for the file.
Example:
"file_xK9mLPqRtN3vS8wF5hB2cQ"
-
getName
public java.lang.String getName()
- Returns:
- The name of the file
Example:
"Invoices.pdf"
-
getType
public java.util.Optional<FileType> getType()
- Returns:
- The type of the file.
Availability: Present when the file type could be determined.
-
getPresignedUrl
public java.util.Optional<java.lang.String> getPresignedUrl()
- Returns:
- 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).
-
getParentFileId
public java.util.Optional<java.lang.String> getParentFileId()
- Returns:
- ID of the parent file.
Availability: Present for files created via a Splitter in a workflow.
-
getContents
public java.util.Optional<FileContents> getContents()
- Returns:
- 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.
-
getMetadata
public FileMetadata getMetadata()
-
getCreatedAt
public java.time.OffsetDateTime getCreatedAt()
-
getUpdatedAt
public java.time.OffsetDateTime getUpdatedAt()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getAdditionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalProperties()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static File.IdStage builder()
-
-