Class EditRun.Builder
- java.lang.Object
-
- ai.extend.types.EditRun.Builder
-
- All Implemented Interfaces:
EditRun._FinalStage,EditRun.ConfigStage,EditRun.FileStage,EditRun.IdStage,EditRun.StatusStage
- Enclosing class:
- EditRun
public static final class EditRun.Builder extends java.lang.Object implements EditRun.IdStage, EditRun.FileStage, EditRun.StatusStage, EditRun.ConfigStage, EditRun._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EditRunbuild()EditRun._FinalStageconfig(EditConfig config)The configuration used for this edit run, including any default values that were applied.EditRun._FinalStagefailureMessage(Nullable<java.lang.String> failureMessage)A human-readable description of the failure.EditRun._FinalStagefailureMessage(java.lang.String failureMessage)A human-readable description of the failure.EditRun._FinalStagefailureMessage(java.util.Optional<java.lang.String> failureMessage)A human-readable description of the failure.EditRun._FinalStagefailureReason(Nullable<java.lang.String> failureReason)The reason for failure.EditRun._FinalStagefailureReason(java.lang.String failureReason)The reason for failure.EditRun._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)The reason for failure.EditRun.StatusStagefile(FileSummary file)The input file that was submitted for editing.EditRun.Builderfrom(EditRun other)EditRun.FileStageid(java.lang.String id)A unique identifier for the edit run.EditRun._FinalStagemetrics(Nullable<EditRunMetrics> metrics)Metrics about the editing process.EditRun._FinalStagemetrics(EditRunMetrics metrics)Metrics about the editing process.EditRun._FinalStagemetrics(java.util.Optional<EditRunMetrics> metrics)Metrics about the editing process.EditRun._FinalStageoutput(Nullable<EditRunOutput> output)The output of the edit run.EditRun._FinalStageoutput(EditRunOutput output)The output of the edit run.EditRun._FinalStageoutput(java.util.Optional<EditRunOutput> output)The output of the edit run.EditRun.ConfigStagestatus(EditRunStatus status)The status of the edit run:EditRun._FinalStageusage(Nullable<RunUsage> usage)Usage credits consumed by this run.EditRun._FinalStageusage(RunUsage usage)Usage credits consumed by this run.EditRun._FinalStageusage(java.util.Optional<RunUsage> usage)Usage credits consumed by this run.
-
-
-
Method Detail
-
from
public EditRun.Builder from(EditRun other)
- Specified by:
fromin interfaceEditRun.IdStage
-
id
public EditRun.FileStage id(@NotNull java.lang.String id)
A unique identifier for the edit run.
Example:
"edr_xK9mLPqRtN3vS8wF5hB2cQ"A unique identifier for the edit run.
Example:
"edr_xK9mLPqRtN3vS8wF5hB2cQ"- Specified by:
idin interfaceEditRun.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
file
public EditRun.StatusStage file(@NotNull FileSummary file)
The input file that was submitted for editing.
The input file that was submitted for editing.
- Specified by:
filein interfaceEditRun.FileStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public EditRun.ConfigStage status(@NotNull EditRunStatus status)
The status of the edit run:
"PROCESSING"- The file is still being processed"PROCESSED"- The file was successfully edited"FAILED"- The editing failed (seefailureReasonfor details)
The status of the edit run:
"PROCESSING"- The file is still being processed"PROCESSED"- The file was successfully edited"FAILED"- The editing failed (seefailureReasonfor details)
- Specified by:
statusin interfaceEditRun.StatusStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
config
public EditRun._FinalStage config(@NotNull EditConfig config)
The configuration used for this edit run, including any default values that were applied.
The configuration used for this edit run, including any default values that were applied.
- Specified by:
configin interfaceEditRun.ConfigStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public EditRun._FinalStage usage(Nullable<RunUsage> usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.- Specified by:
usagein interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public EditRun._FinalStage usage(RunUsage usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.- Specified by:
usagein interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public EditRun._FinalStage usage(java.util.Optional<RunUsage> usage)
Usage credits consumed by this run.
Availability: Present when
statusis"PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.- Specified by:
usagein interfaceEditRun._FinalStage
-
metrics
public EditRun._FinalStage metrics(Nullable<EditRunMetrics> metrics)
Metrics about the editing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metrics
public EditRun._FinalStage metrics(EditRunMetrics metrics)
Metrics about the editing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metrics
public EditRun._FinalStage metrics(java.util.Optional<EditRunMetrics> metrics)
Metrics about the editing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceEditRun._FinalStage
-
output
public EditRun._FinalStage output(Nullable<EditRunOutput> output)
The output of the edit run.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
output
public EditRun._FinalStage output(EditRunOutput output)
The output of the edit run.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
output
public EditRun._FinalStage output(java.util.Optional<EditRunOutput> output)
The output of the edit run.
Availability: Present when
statusis"PROCESSED".- Specified by:
outputin interfaceEditRun._FinalStage
-
failureMessage
public EditRun._FinalStage failureMessage(Nullable<java.lang.String> failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public EditRun._FinalStage failureMessage(java.lang.String failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public EditRun._FinalStage failureMessage(java.util.Optional<java.lang.String> failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceEditRun._FinalStage
-
failureReason
public EditRun._FinalStage failureReason(Nullable<java.lang.String> failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
UNABLE_TO_DOWNLOAD_FILE- Failed to load the requested fileFILE_TYPE_NOT_SUPPORTED- File type not supported. Edit runs currently require a PDFFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted and cannot be editedFIELD_DETECTION_ERROR- An error occurred during field detectionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be editedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingINTERNAL_ERROR- An unexpected internal error occurredINVALID_OPTIONS- The provided configuration options are invalidEMPTY_SCHEMA- No schema was provided and no fields could be detectedOUT_OF_CREDITS- Insufficient credits to process the file
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public EditRun._FinalStage failureReason(java.lang.String failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
UNABLE_TO_DOWNLOAD_FILE- Failed to load the requested fileFILE_TYPE_NOT_SUPPORTED- File type not supported. Edit runs currently require a PDFFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted and cannot be editedFIELD_DETECTION_ERROR- An error occurred during field detectionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be editedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingINTERNAL_ERROR- An unexpected internal error occurredINVALID_OPTIONS- The provided configuration options are invalidEMPTY_SCHEMA- No schema was provided and no fields could be detectedOUT_OF_CREDITS- Insufficient credits to process the file
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceEditRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public EditRun._FinalStage failureReason(java.util.Optional<java.lang.String> failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
UNABLE_TO_DOWNLOAD_FILE- Failed to load the requested fileFILE_TYPE_NOT_SUPPORTED- File type not supported. Edit runs currently require a PDFFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted and cannot be editedFIELD_DETECTION_ERROR- An error occurred during field detectionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be editedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingINTERNAL_ERROR- An unexpected internal error occurredINVALID_OPTIONS- The provided configuration options are invalidEMPTY_SCHEMA- No schema was provided and no fields could be detectedOUT_OF_CREDITS- Insufficient credits to process the file
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
- Specified by:
failureReasonin interfaceEditRun._FinalStage
-
build
public EditRun build()
- Specified by:
buildin interfaceEditRun._FinalStage
-
-