Class ParseRunSummary.Builder
- java.lang.Object
-
- ai.extend.types.ParseRunSummary.Builder
-
- All Implemented Interfaces:
ParseRunSummary._FinalStage,ParseRunSummary.CreatedAtStage,ParseRunSummary.FileStage,ParseRunSummary.IdStage,ParseRunSummary.StatusStage,ParseRunSummary.UpdatedAtStage
- Enclosing class:
- ParseRunSummary
public static final class ParseRunSummary.Builder extends java.lang.Object implements ParseRunSummary.IdStage, ParseRunSummary.FileStage, ParseRunSummary.StatusStage, ParseRunSummary.CreatedAtStage, ParseRunSummary.UpdatedAtStage, ParseRunSummary._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParseRunSummary._FinalStagebatchId(Nullable<java.lang.String> batchId)The ID of the batch this run belongs to, if created viaPOST /parse_runs/batch.ParseRunSummary._FinalStagebatchId(java.lang.String batchId)The ID of the batch this run belongs to, if created viaPOST /parse_runs/batch.ParseRunSummary._FinalStagebatchId(java.util.Optional<java.lang.String> batchId)The ID of the batch this run belongs to, if created viaPOST /parse_runs/batch.ParseRunSummarybuild()ParseRunSummary.UpdatedAtStagecreatedAt(java.time.OffsetDateTime createdAt)ParseRunSummary._FinalStagefailureMessage(Nullable<java.lang.String> failureMessage)A human-readable description of the failure.ParseRunSummary._FinalStagefailureMessage(java.lang.String failureMessage)A human-readable description of the failure.ParseRunSummary._FinalStagefailureMessage(java.util.Optional<java.lang.String> failureMessage)A human-readable description of the failure.ParseRunSummary._FinalStagefailureReason(Nullable<java.lang.String> failureReason)The reason for failure.ParseRunSummary._FinalStagefailureReason(java.lang.String failureReason)The reason for failure.ParseRunSummary._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)The reason for failure.ParseRunSummary.StatusStagefile(FileSummary file)The file that was parsed.ParseRunSummary.Builderfrom(ParseRunSummary other)ParseRunSummary.FileStageid(java.lang.String id)A unique identifier for the parse run.ParseRunSummary._FinalStagemetadata(Nullable<java.util.Map<java.lang.String,java.lang.Object>> metadata)Any metadata that was provided when creating the parse run.ParseRunSummary._FinalStagemetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)Any metadata that was provided when creating the parse run.ParseRunSummary._FinalStagemetadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)Any metadata that was provided when creating the parse run.ParseRunSummary._FinalStagemetrics(Nullable<ParseRunSummaryMetrics> metrics)Metrics about the parsing process.ParseRunSummary._FinalStagemetrics(ParseRunSummaryMetrics metrics)Metrics about the parsing process.ParseRunSummary._FinalStagemetrics(java.util.Optional<ParseRunSummaryMetrics> metrics)Metrics about the parsing process.ParseRunSummary.CreatedAtStagestatus(ParseRunSummaryStatus status)The status of the parse run:ParseRunSummary._FinalStageupdatedAt(java.time.OffsetDateTime updatedAt)ParseRunSummary._FinalStageusage(Nullable<RunUsageSummary> usage)Usage credits consumed by this parse run.ParseRunSummary._FinalStageusage(RunUsageSummary usage)Usage credits consumed by this parse run.ParseRunSummary._FinalStageusage(java.util.Optional<RunUsageSummary> usage)Usage credits consumed by this parse run.
-
-
-
Method Detail
-
from
public ParseRunSummary.Builder from(ParseRunSummary other)
- Specified by:
fromin interfaceParseRunSummary.IdStage
-
id
public ParseRunSummary.FileStage id(@NotNull java.lang.String id)
A unique identifier for the parse run.
Example:
"pr_xK9mLPqRtN3vS8wF5hB2cQ"A unique identifier for the parse run.
Example:
"pr_xK9mLPqRtN3vS8wF5hB2cQ"- Specified by:
idin interfaceParseRunSummary.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
file
public ParseRunSummary.StatusStage file(@NotNull FileSummary file)
The file that was parsed. This file can be used as a parameter for other Extend endpoints, such as
POST /workflow_runs. May benullfor batch parse runs where file ingestion failed.The file that was parsed. This file can be used as a parameter for other Extend endpoints, such as
POST /workflow_runs. May benullfor batch parse runs where file ingestion failed.- Specified by:
filein interfaceParseRunSummary.FileStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public ParseRunSummary.CreatedAtStage status(@NotNull ParseRunSummaryStatus status)
The status of the parse run:
"PENDING"- The run has been created and is waiting to be processed. Only applies to runs created viaPOST /parse_runs/batch."PROCESSING"- The file is still being processed"PROCESSED"- The file was successfully processed"FAILED"- The processing failed (seefailureReasonfor details)
The status of the parse run:
"PENDING"- The run has been created and is waiting to be processed. Only applies to runs created viaPOST /parse_runs/batch."PROCESSING"- The file is still being processed"PROCESSED"- The file was successfully processed"FAILED"- The processing failed (seefailureReasonfor details)
- Specified by:
statusin interfaceParseRunSummary.StatusStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
createdAt
public ParseRunSummary.UpdatedAtStage createdAt(@NotNull java.time.OffsetDateTime createdAt)
- Specified by:
createdAtin interfaceParseRunSummary.CreatedAtStage
-
updatedAt
public ParseRunSummary._FinalStage updatedAt(@NotNull java.time.OffsetDateTime updatedAt)
- Specified by:
updatedAtin interfaceParseRunSummary.UpdatedAtStage
-
usage
public ParseRunSummary._FinalStage usage(Nullable<RunUsageSummary> usage)
Usage credits consumed by this parse run. Omits
breakdown— fetch the full parse run by id to see the per-line items.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 interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public ParseRunSummary._FinalStage usage(RunUsageSummary usage)
Usage credits consumed by this parse run. Omits
breakdown— fetch the full parse run by id to see the per-line items.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 interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public ParseRunSummary._FinalStage usage(java.util.Optional<RunUsageSummary> usage)
Usage credits consumed by this parse run. Omits
breakdown— fetch the full parse run by id to see the per-line items.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 interfaceParseRunSummary._FinalStage
-
metrics
public ParseRunSummary._FinalStage metrics(Nullable<ParseRunSummaryMetrics> metrics)
Metrics about the parsing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metrics
public ParseRunSummary._FinalStage metrics(ParseRunSummaryMetrics metrics)
Metrics about the parsing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metrics
public ParseRunSummary._FinalStage metrics(java.util.Optional<ParseRunSummaryMetrics> metrics)
Metrics about the parsing process.
Availability: Present when
statusis"PROCESSED".- Specified by:
metricsin interfaceParseRunSummary._FinalStage
-
metadata
public ParseRunSummary._FinalStage metadata(Nullable<java.util.Map<java.lang.String,java.lang.Object>> metadata)
Any metadata that was provided when creating the parse run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ParseRunSummary._FinalStage metadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
Any metadata that was provided when creating the parse run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ParseRunSummary._FinalStage metadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)
Any metadata that was provided when creating the parse run.
Availability: Present when metadata was provided during creation.
- Specified by:
metadatain interfaceParseRunSummary._FinalStage
-
failureMessage
public ParseRunSummary._FinalStage failureMessage(Nullable<java.lang.String> failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public ParseRunSummary._FinalStage failureMessage(java.lang.String failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public ParseRunSummary._FinalStage failureMessage(java.util.Optional<java.lang.String> failureMessage)
A human-readable description of the failure.
Availability: Present when
statusis"FAILED".- Specified by:
failureMessagein interfaceParseRunSummary._FinalStage
-
failureReason
public ParseRunSummary._FinalStage failureReason(Nullable<java.lang.String> failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
UNABLE_TO_DOWNLOAD_FILE- The file could not be downloaded from the provided URLFILE_TYPE_NOT_SUPPORTED- The file type is not supported for parsingFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted or malformedOCR_ERROR- An error occurred during optical character recognitionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be processedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingFAILED_TO_CONVERT_TO_JPEG- The file could not be converted to JPEG for processingFAILED_TO_GENERATE_TARGET_FORMAT- The output could not be generated in the requested formatCHUNKING_ERROR- An error occurred while chunking the documentINTERNAL_ERROR- An unexpected internal error occurredINVALID_CONFIG_OPTIONS- The provided configuration options are invalidOUT_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 interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ParseRunSummary._FinalStage failureReason(java.lang.String failureReason)
The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
UNABLE_TO_DOWNLOAD_FILE- The file could not be downloaded from the provided URLFILE_TYPE_NOT_SUPPORTED- The file type is not supported for parsingFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted or malformedOCR_ERROR- An error occurred during optical character recognitionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be processedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingFAILED_TO_CONVERT_TO_JPEG- The file could not be converted to JPEG for processingFAILED_TO_GENERATE_TARGET_FORMAT- The output could not be generated in the requested formatCHUNKING_ERROR- An error occurred while chunking the documentINTERNAL_ERROR- An unexpected internal error occurredINVALID_CONFIG_OPTIONS- The provided configuration options are invalidOUT_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 interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ParseRunSummary._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- The file could not be downloaded from the provided URLFILE_TYPE_NOT_SUPPORTED- The file type is not supported for parsingFILE_SIZE_TOO_LARGE- The file exceeds the maximum allowed sizeCORRUPT_FILE- The file appears to be corrupted or malformedOCR_ERROR- An error occurred during optical character recognitionPASSWORD_PROTECTED_FILE- The file is password protected and cannot be processedFAILED_TO_CONVERT_TO_PDF- The file could not be converted to PDF for processingFAILED_TO_CONVERT_TO_JPEG- The file could not be converted to JPEG for processingFAILED_TO_GENERATE_TARGET_FORMAT- The output could not be generated in the requested formatCHUNKING_ERROR- An error occurred while chunking the documentINTERNAL_ERROR- An unexpected internal error occurredINVALID_CONFIG_OPTIONS- The provided configuration options are invalidOUT_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 interfaceParseRunSummary._FinalStage
-
batchId
public ParseRunSummary._FinalStage batchId(Nullable<java.lang.String> batchId)
The ID of the batch this run belongs to, if created via
POST /parse_runs/batch.Availability: Present when the run was submitted as part of a batch.
Example:
"bpar_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
batchIdin interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
batchId
public ParseRunSummary._FinalStage batchId(java.lang.String batchId)
The ID of the batch this run belongs to, if created via
POST /parse_runs/batch.Availability: Present when the run was submitted as part of a batch.
Example:
"bpar_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
batchIdin interfaceParseRunSummary._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
batchId
public ParseRunSummary._FinalStage batchId(java.util.Optional<java.lang.String> batchId)
The ID of the batch this run belongs to, if created via
POST /parse_runs/batch.Availability: Present when the run was submitted as part of a batch.
Example:
"bpar_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
batchIdin interfaceParseRunSummary._FinalStage
-
build
public ParseRunSummary build()
- Specified by:
buildin interfaceParseRunSummary._FinalStage
-
-