Class ExtractRun.Builder
- java.lang.Object
-
- ai.extend.types.ExtractRun.Builder
-
- All Implemented Interfaces:
ExtractRun._FinalStage,ExtractRun.ConfigStage,ExtractRun.CreatedAtStage,ExtractRun.DashboardUrlStage,ExtractRun.EditedStage,ExtractRun.FileStage,ExtractRun.IdStage,ExtractRun.ReviewedStage,ExtractRun.StatusStage,ExtractRun.UpdatedAtStage
- Enclosing class:
- ExtractRun
public static final class ExtractRun.Builder extends java.lang.Object implements ExtractRun.IdStage, ExtractRun.StatusStage, ExtractRun.ReviewedStage, ExtractRun.EditedStage, ExtractRun.ConfigStage, ExtractRun.FileStage, ExtractRun.DashboardUrlStage, ExtractRun.CreatedAtStage, ExtractRun.UpdatedAtStage, ExtractRun._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtractRunbuild()ExtractRun.FileStageconfig(ExtractConfig config)The configuration used for this extract run.ExtractRun.UpdatedAtStagecreatedAt(java.time.OffsetDateTime createdAt)ExtractRun.CreatedAtStagedashboardUrl(java.lang.String dashboardUrl)The URL to view the extract run in the Extend dashboard.ExtractRun.ConfigStageedited(boolean edited)Indicates whether the run results have been edited during review.ExtractRun._FinalStageedits(Nullable<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>> edits)Details of edits made during review.ExtractRun._FinalStageedits(java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>> edits)Details of edits made during review.ExtractRun._FinalStageedits(java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>> edits)Details of edits made during review.ExtractRun._FinalStageextractor(Nullable<ExtractorSummary> extractor)The extractor that was used for this run.ExtractRun._FinalStageextractor(ExtractorSummary extractor)The extractor that was used for this run.ExtractRun._FinalStageextractor(java.util.Optional<ExtractorSummary> extractor)The extractor that was used for this run.ExtractRun._FinalStageextractorVersion(Nullable<ExtractorVersionSummary> extractorVersion)The version of the extractor that was used for this run.ExtractRun._FinalStageextractorVersion(ExtractorVersionSummary extractorVersion)The version of the extractor that was used for this run.ExtractRun._FinalStageextractorVersion(java.util.Optional<ExtractorVersionSummary> extractorVersion)The version of the extractor that was used for this run.ExtractRun._FinalStagefailureMessage(Nullable<java.lang.String> failureMessage)A detailed message about the failure.ExtractRun._FinalStagefailureMessage(java.lang.String failureMessage)A detailed message about the failure.ExtractRun._FinalStagefailureMessage(java.util.Optional<java.lang.String> failureMessage)A detailed message about the failure.ExtractRun._FinalStagefailureReason(Nullable<java.lang.String> failureReason)The reason for failure.ExtractRun._FinalStagefailureReason(java.lang.String failureReason)The reason for failure.ExtractRun._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)The reason for failure.ExtractRun.DashboardUrlStagefile(FileSummary file)The file that was processed.ExtractRun.Builderfrom(ExtractRun other)ExtractRun.StatusStageid(java.lang.String id)The unique identifier for this extract run.ExtractRun._FinalStageinitialOutput(Nullable<ExtractOutput> initialOutput)The initial output from the extract run, before any review edits.ExtractRun._FinalStageinitialOutput(ExtractOutput initialOutput)The initial output from the extract run, before any review edits.ExtractRun._FinalStageinitialOutput(java.util.Optional<ExtractOutput> initialOutput)The initial output from the extract run, before any review edits.ExtractRun._FinalStagemetadata(Nullable<java.util.Map<java.lang.String,java.lang.Object>> metadata)Any metadata that was provided when creating the extract run.ExtractRun._FinalStagemetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)Any metadata that was provided when creating the extract run.ExtractRun._FinalStagemetadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)Any metadata that was provided when creating the extract run.ExtractRun._FinalStageoutput(Nullable<ExtractOutput> output)The final output, either reviewed or initial.ExtractRun._FinalStageoutput(ExtractOutput output)The final output, either reviewed or initial.ExtractRun._FinalStageoutput(java.util.Optional<ExtractOutput> output)The final output, either reviewed or initial.ExtractRun._FinalStageparseRunId(Nullable<java.lang.String> parseRunId)The ID of the parse run that was used for this extract run.ExtractRun._FinalStageparseRunId(java.lang.String parseRunId)The ID of the parse run that was used for this extract run.ExtractRun._FinalStageparseRunId(java.util.Optional<java.lang.String> parseRunId)The ID of the parse run that was used for this extract run.ExtractRun.EditedStagereviewed(boolean reviewed)Indicates whether the run has been reviewed by a human.ExtractRun._FinalStagereviewedOutput(Nullable<ExtractOutput> reviewedOutput)The output after human review.ExtractRun._FinalStagereviewedOutput(ExtractOutput reviewedOutput)The output after human review.ExtractRun._FinalStagereviewedOutput(java.util.Optional<ExtractOutput> reviewedOutput)The output after human review.ExtractRun.ReviewedStagestatus(ProcessorRunStatus status)ExtractRun._FinalStageupdatedAt(java.time.OffsetDateTime updatedAt)ExtractRun._FinalStageusage(Nullable<RunUsage> usage)Usage credits consumed by this run.ExtractRun._FinalStageusage(RunUsage usage)Usage credits consumed by this run.ExtractRun._FinalStageusage(java.util.Optional<RunUsage> usage)Usage credits consumed by this run.
-
-
-
Method Detail
-
from
public ExtractRun.Builder from(ExtractRun other)
- Specified by:
fromin interfaceExtractRun.IdStage
-
id
public ExtractRun.StatusStage id(@NotNull java.lang.String id)
The unique identifier for this extract run.
Example:
"exr_Xj8mK2pL9nR4vT7qY5wZ"The unique identifier for this extract run.
Example:
"exr_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
idin interfaceExtractRun.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public ExtractRun.ReviewedStage status(@NotNull ProcessorRunStatus status)
- Specified by:
statusin interfaceExtractRun.StatusStage
-
reviewed
public ExtractRun.EditedStage reviewed(boolean reviewed)
Indicates whether the run has been reviewed by a human.
Indicates whether the run has been reviewed by a human.
- Specified by:
reviewedin interfaceExtractRun.ReviewedStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
edited
public ExtractRun.ConfigStage edited(boolean edited)
Indicates whether the run results have been edited during review.
Indicates whether the run results have been edited during review.
- Specified by:
editedin interfaceExtractRun.EditedStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
config
public ExtractRun.FileStage config(@NotNull ExtractConfig config)
The configuration used for this extract run.
The configuration used for this extract run.
- Specified by:
configin interfaceExtractRun.ConfigStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
file
public ExtractRun.DashboardUrlStage file(@NotNull FileSummary file)
The file that was processed.
The file that was processed.
- Specified by:
filein interfaceExtractRun.FileStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
dashboardUrl
public ExtractRun.CreatedAtStage dashboardUrl(@NotNull java.lang.String dashboardUrl)
The URL to view the extract run in the Extend dashboard.
The URL to view the extract run in the Extend dashboard.
- Specified by:
dashboardUrlin interfaceExtractRun.DashboardUrlStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
createdAt
public ExtractRun.UpdatedAtStage createdAt(@NotNull java.time.OffsetDateTime createdAt)
- Specified by:
createdAtin interfaceExtractRun.CreatedAtStage
-
updatedAt
public ExtractRun._FinalStage updatedAt(@NotNull java.time.OffsetDateTime updatedAt)
- Specified by:
updatedAtin interfaceExtractRun.UpdatedAtStage
-
usage
public ExtractRun._FinalStage usage(Nullable<RunUsage> usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED".- Specified by:
usagein interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public ExtractRun._FinalStage usage(RunUsage usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED".- Specified by:
usagein interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public ExtractRun._FinalStage usage(java.util.Optional<RunUsage> usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED".- Specified by:
usagein interfaceExtractRun._FinalStage
-
parseRunId
public ExtractRun._FinalStage parseRunId(Nullable<java.lang.String> parseRunId)
The ID of the parse run that was used for this extract run.
Availability: Present when a parse run was created.
- Specified by:
parseRunIdin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
parseRunId
public ExtractRun._FinalStage parseRunId(java.lang.String parseRunId)
The ID of the parse run that was used for this extract run.
Availability: Present when a parse run was created.
- Specified by:
parseRunIdin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
parseRunId
public ExtractRun._FinalStage parseRunId(java.util.Optional<java.lang.String> parseRunId)
The ID of the parse run that was used for this extract run.
Availability: Present when a parse run was created.
- Specified by:
parseRunIdin interfaceExtractRun._FinalStage
-
edits
public ExtractRun._FinalStage edits(Nullable<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>> edits)
Details of edits made during review.
Availability: Present when
editedistrue.- Specified by:
editsin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
edits
public ExtractRun._FinalStage edits(java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>> edits)
Details of edits made during review.
Availability: Present when
editedistrue.- Specified by:
editsin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
edits
public ExtractRun._FinalStage edits(java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>> edits)
Details of edits made during review.
Availability: Present when
editedistrue.- Specified by:
editsin interfaceExtractRun._FinalStage
-
metadata
public ExtractRun._FinalStage metadata(Nullable<java.util.Map<java.lang.String,java.lang.Object>> metadata)
Any metadata that was provided when creating the extract run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ExtractRun._FinalStage metadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
Any metadata that was provided when creating the extract run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ExtractRun._FinalStage metadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)
Any metadata that was provided when creating the extract run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceExtractRun._FinalStage
-
failureMessage
public ExtractRun._FinalStage failureMessage(Nullable<java.lang.String> failureMessage)
A detailed message about the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public ExtractRun._FinalStage failureMessage(java.lang.String failureMessage)
A detailed message about the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public ExtractRun._FinalStage failureMessage(java.util.Optional<java.lang.String> failureMessage)
A detailed message about the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceExtractRun._FinalStage
-
failureReason
public ExtractRun._FinalStage failureReason(Nullable<java.lang.String> failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
ABORTED- The run was aborted by the userINTERNAL_ERROR- An unexpected internal error occurredFAILED_TO_PROCESS_FILE- Failed to process the file (e.g., OCR failure, file access issues)INVALID_PROCESSOR- The processor configuration is invalidINVALID_CONFIGURATION- The provided configuration is incompatible with the selected modelPARSING_ERROR- Failed to parse the extraction outputPRE_PROCESSING_FAILURE- An error occurred during preprocessing (e.g., chunking)POST_PROCESSING_FAILURE- An error occurred during postprocessingOUT_OF_CREDITS- Insufficient credits to run the extraction
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ExtractRun._FinalStage failureReason(java.lang.String failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
ABORTED- The run was aborted by the userINTERNAL_ERROR- An unexpected internal error occurredFAILED_TO_PROCESS_FILE- Failed to process the file (e.g., OCR failure, file access issues)INVALID_PROCESSOR- The processor configuration is invalidINVALID_CONFIGURATION- The provided configuration is incompatible with the selected modelPARSING_ERROR- Failed to parse the extraction outputPRE_PROCESSING_FAILURE- An error occurred during preprocessing (e.g., chunking)POST_PROCESSING_FAILURE- An error occurred during postprocessingOUT_OF_CREDITS- Insufficient credits to run the extraction
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ExtractRun._FinalStage failureReason(java.util.Optional<java.lang.String> failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
ABORTED- The run was aborted by the userINTERNAL_ERROR- An unexpected internal error occurredFAILED_TO_PROCESS_FILE- Failed to process the file (e.g., OCR failure, file access issues)INVALID_PROCESSOR- The processor configuration is invalidINVALID_CONFIGURATION- The provided configuration is incompatible with the selected modelPARSING_ERROR- Failed to parse the extraction outputPRE_PROCESSING_FAILURE- An error occurred during preprocessing (e.g., chunking)POST_PROCESSING_FAILURE- An error occurred during postprocessingOUT_OF_CREDITS- Insufficient credits to run the extraction
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceExtractRun._FinalStage
-
reviewedOutput
public ExtractRun._FinalStage reviewedOutput(Nullable<ExtractOutput> reviewedOutput)
The output after human review.
Availability: Present when
reviewedistrue.- Specified by:
reviewedOutputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewedOutput
public ExtractRun._FinalStage reviewedOutput(ExtractOutput reviewedOutput)
The output after human review.
Availability: Present when
reviewedistrue.- Specified by:
reviewedOutputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewedOutput
public ExtractRun._FinalStage reviewedOutput(java.util.Optional<ExtractOutput> reviewedOutput)
The output after human review.
Availability: Present when
reviewedistrue.- Specified by:
reviewedOutputin interfaceExtractRun._FinalStage
-
initialOutput
public ExtractRun._FinalStage initialOutput(Nullable<ExtractOutput> initialOutput)
The initial output from the extract run, before any review edits.
Availability: Present when
reviewedistrue.- Specified by:
initialOutputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
initialOutput
public ExtractRun._FinalStage initialOutput(ExtractOutput initialOutput)
The initial output from the extract run, before any review edits.
Availability: Present when
reviewedistrue.- Specified by:
initialOutputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
initialOutput
public ExtractRun._FinalStage initialOutput(java.util.Optional<ExtractOutput> initialOutput)
The initial output from the extract run, before any review edits.
Availability: Present when
reviewedistrue.- Specified by:
initialOutputin interfaceExtractRun._FinalStage
-
output
public ExtractRun._FinalStage output(Nullable<ExtractOutput> output)
The final output, either reviewed or initial.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
output
public ExtractRun._FinalStage output(ExtractOutput output)
The final output, either reviewed or initial.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
output
public ExtractRun._FinalStage output(java.util.Optional<ExtractOutput> output)
The final output, either reviewed or initial.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceExtractRun._FinalStage
-
extractorVersion
public ExtractRun._FinalStage extractorVersion(Nullable<ExtractorVersionSummary> extractorVersion)
The version of the extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorVersionin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
extractorVersion
public ExtractRun._FinalStage extractorVersion(ExtractorVersionSummary extractorVersion)
The version of the extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorVersionin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
extractorVersion
public ExtractRun._FinalStage extractorVersion(java.util.Optional<ExtractorVersionSummary> extractorVersion)
The version of the extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorVersionin interfaceExtractRun._FinalStage
-
extractor
public ExtractRun._FinalStage extractor(Nullable<ExtractorSummary> extractor)
The extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
extractor
public ExtractRun._FinalStage extractor(ExtractorSummary extractor)
The extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorin interfaceExtractRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
extractor
public ExtractRun._FinalStage extractor(java.util.Optional<ExtractorSummary> extractor)
The extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.- Specified by:
extractorin interfaceExtractRun._FinalStage
-
build
public ExtractRun build()
- Specified by:
buildin interfaceExtractRun._FinalStage
-
-