Class ExtractRun.Builder

    • Method Detail

      • 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:
        id in interface ExtractRun.IdStage
        Returns:
        Reference to this so that method calls can be chained together.
      • 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:
        reviewed in interface ExtractRun.ReviewedStage
        Returns:
        Reference to this so 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:
        edited in interface ExtractRun.EditedStage
        Returns:
        Reference to this so that method calls can be chained together.
      • config

        public ExtractRun.DashboardUrlStage config​(@NotNull
                                                   ExtractConfig config)

        The configuration used for this extract run. This is a union of two possible shapes:

        • JSON Schema config: The current config format. All runs created through this API version use this shape.
        • Legacy config: A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs.

        The configuration used for this extract run. This is a union of two possible shapes:

        • JSON Schema config: The current config format. All runs created through this API version use this shape.
        • Legacy config: A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs.
        Specified by:
        config in interface ExtractRun.ConfigStage
        Returns:
        Reference to this so 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:
        dashboardUrl in interface ExtractRun.DashboardUrlStage
        Returns:
        Reference to this so that method calls can be chained together.
      • usage

        public ExtractRun._FinalStage usage​(Nullable<RunUsage> usage)

        Usage credits consumed by this extract run.

        Availability: Present when status is "PROCESSED". Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.

        Specified by:
        usage in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • usage

        public ExtractRun._FinalStage usage​(RunUsage usage)

        Usage credits consumed by this extract run.

        Availability: Present when status is "PROCESSED". Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.

        Specified by:
        usage in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • usage

        public ExtractRun._FinalStage usage​(java.util.Optional<RunUsage> usage)

        Usage credits consumed by this extract run.

        Availability: Present when status is "PROCESSED". Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.

        Specified by:
        usage in interface ExtractRun._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:
        parseRunId in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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:
        parseRunId in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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:
        parseRunId in interface ExtractRun._FinalStage
      • files

        public ExtractRun._FinalStage files​(Nullable<java.util.List<FileSummary>> files)

        The files that were processed, in the order they were submitted. Only populated for multifile runs (created with package).

        For single-file runs, this is null — use file instead.

        Specified by:
        files in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • files

        public ExtractRun._FinalStage files​(java.util.List<FileSummary> files)

        The files that were processed, in the order they were submitted. Only populated for multifile runs (created with package).

        For single-file runs, this is null — use file instead.

        Specified by:
        files in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • files

        public ExtractRun._FinalStage files​(java.util.Optional<java.util.List<FileSummary>> files)

        The files that were processed, in the order they were submitted. Only populated for multifile runs (created with package).

        For single-file runs, this is null — use file instead.

        Specified by:
        files in interface ExtractRun._FinalStage
      • file

        public ExtractRun._FinalStage file​(Nullable<FileSummary> file)

        The file that was processed. null for multifile runs (use files instead), and null when the file could not be accessed or processed (for example, a run that failed during file ingestion).

        Specified by:
        file in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • file

        public ExtractRun._FinalStage file​(FileSummary file)

        The file that was processed. null for multifile runs (use files instead), and null when the file could not be accessed or processed (for example, a run that failed during file ingestion).

        Specified by:
        file in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • file

        public ExtractRun._FinalStage file​(java.util.Optional<FileSummary> file)

        The file that was processed. null for multifile runs (use files instead), and null when the file could not be accessed or processed (for example, a run that failed during file ingestion).

        Specified by:
        file in interface ExtractRun._FinalStage
      • 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:
        extractor in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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 edited is true.

        Specified by:
        edits in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • 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:
        metadata in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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:
        metadata in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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:
        metadata in interface ExtractRun._FinalStage
      • failureMessage

        public ExtractRun._FinalStage failureMessage​(Nullable<java.lang.String> failureMessage)

        A detailed message about the failure.

        Availability: Present when status is "FAILED".

        Specified by:
        failureMessage in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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 status is "FAILED".

        Specified by:
        failureMessage in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • failureReason

        public ExtractRun._FinalStage failureReason​(Nullable<java.lang.String> failureReason)

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • ABORTED - The run was aborted by the user
        • INTERNAL_ERROR - An unexpected internal error occurred
        • FAILED_TO_PROCESS_FILE - Failed to process the file (e.g., OCR failure, file access issues)
        • INVALID_PROCESSOR - The processor configuration is invalid
        • INVALID_CONFIGURATION - The provided configuration is incompatible with the selected model
        • PARSING_ERROR - Failed to parse the extraction output
        • PRE_PROCESSING_FAILURE - An error occurred during preprocessing (e.g., chunking)
        • POST_PROCESSING_FAILURE - An error occurred during postprocessing
        • OUT_OF_CREDITS - Insufficient credits to run the extraction
        • SCHEMA_GENERATION_FAILED - Automatic schema inference failed (only applies when schema is omitted). The file could not be parsed or a schema could not be generated from it.

        Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.

        Specified by:
        failureReason in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • failureReason

        public ExtractRun._FinalStage failureReason​(java.lang.String failureReason)

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • ABORTED - The run was aborted by the user
        • INTERNAL_ERROR - An unexpected internal error occurred
        • FAILED_TO_PROCESS_FILE - Failed to process the file (e.g., OCR failure, file access issues)
        • INVALID_PROCESSOR - The processor configuration is invalid
        • INVALID_CONFIGURATION - The provided configuration is incompatible with the selected model
        • PARSING_ERROR - Failed to parse the extraction output
        • PRE_PROCESSING_FAILURE - An error occurred during preprocessing (e.g., chunking)
        • POST_PROCESSING_FAILURE - An error occurred during postprocessing
        • OUT_OF_CREDITS - Insufficient credits to run the extraction
        • SCHEMA_GENERATION_FAILED - Automatic schema inference failed (only applies when schema is omitted). The file could not be parsed or a schema could not be generated from it.

        Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.

        Specified by:
        failureReason in interface ExtractRun._FinalStage
        Returns:
        Reference to this so 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 status is "FAILED".

        Possible values include:

        • ABORTED - The run was aborted by the user
        • INTERNAL_ERROR - An unexpected internal error occurred
        • FAILED_TO_PROCESS_FILE - Failed to process the file (e.g., OCR failure, file access issues)
        • INVALID_PROCESSOR - The processor configuration is invalid
        • INVALID_CONFIGURATION - The provided configuration is incompatible with the selected model
        • PARSING_ERROR - Failed to parse the extraction output
        • PRE_PROCESSING_FAILURE - An error occurred during preprocessing (e.g., chunking)
        • POST_PROCESSING_FAILURE - An error occurred during postprocessing
        • OUT_OF_CREDITS - Insufficient credits to run the extraction
        • SCHEMA_GENERATION_FAILED - Automatic schema inference failed (only applies when schema is omitted). The file could not be parsed or a schema could not be generated from it.

        Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.

        Specified by:
        failureReason in interface ExtractRun._FinalStage
      • output

        public ExtractRun._FinalStage output​(Nullable<ExtractOutput> output)

        The final output, either reviewed or initial. This is a union of two possible shapes:

        • JSON Schema output: The current output format, returned for runs created with a JSON Schema config.
        • Legacy output: A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config.

        Availability: Present when status is "PROCESSED".

        Specified by:
        output in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • output

        public ExtractRun._FinalStage output​(ExtractOutput output)

        The final output, either reviewed or initial. This is a union of two possible shapes:

        • JSON Schema output: The current output format, returned for runs created with a JSON Schema config.
        • Legacy output: A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config.

        Availability: Present when status is "PROCESSED".

        Specified by:
        output in interface ExtractRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • output

        public ExtractRun._FinalStage output​(java.util.Optional<ExtractOutput> output)

        The final output, either reviewed or initial. This is a union of two possible shapes:

        • JSON Schema output: The current output format, returned for runs created with a JSON Schema config.
        • Legacy output: A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config.

        Availability: Present when status is "PROCESSED".

        Specified by:
        output in interface ExtractRun._FinalStage