Class ParseRun.Builder

    • Method Detail

      • id

        public ParseRun.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:
        id in interface ParseRun.IdStage
        Returns:
        Reference to this so that method calls can be chained together.
      • file

        public ParseRun.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.

        The file that was parsed. This file can be used as a parameter for other Extend endpoints, such as POST /workflow_runs.

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

        public ParseRun.ConfigStage status​(@NotNull
                                           ParseRunStatusEnum status)

        The status of the parse run:

        • "PROCESSING" - The file is still being processed
        • "PROCESSED" - The file was successfully processed
        • "FAILED" - The processing failed (see failureReason for details)

        The status of the parse run:

        • "PROCESSING" - The file is still being processed
        • "PROCESSED" - The file was successfully processed
        • "FAILED" - The processing failed (see failureReason for details)
        Specified by:
        status in interface ParseRun.StatusStage
        Returns:
        Reference to this so that method calls can be chained together.
      • config

        public ParseRun._FinalStage config​(@NotNull
                                           ParseConfig config)

        The configuration used for the parsing process, including any default values that were applied.

        The configuration used for the parsing process, including any default values that were applied.

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

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

        Usage credits consumed by this run.

        Availability: Present when status is "PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.

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

        public ParseRun._FinalStage usage​(RunUsage usage)

        Usage credits consumed by this run.

        Availability: Present when status is "PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.

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

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

        Usage credits consumed by this run.

        Availability: Present when status is "PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.

        Specified by:
        usage in interface ParseRun._FinalStage
      • outputUrl

        public ParseRun._FinalStage outputUrl​(Nullable<java.lang.String> outputUrl)

        A presigned URL to download the parse run output as a JSON file. The object shape is the same as the output field. Expires after 15 minutes.

        Availability: Present when status is "PROCESSED" and the request was made with responseType=url query parameter.

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

        public ParseRun._FinalStage outputUrl​(java.lang.String outputUrl)

        A presigned URL to download the parse run output as a JSON file. The object shape is the same as the output field. Expires after 15 minutes.

        Availability: Present when status is "PROCESSED" and the request was made with responseType=url query parameter.

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

        public ParseRun._FinalStage outputUrl​(java.util.Optional<java.lang.String> outputUrl)

        A presigned URL to download the parse run output as a JSON file. The object shape is the same as the output field. Expires after 15 minutes.

        Availability: Present when status is "PROCESSED" and the request was made with responseType=url query parameter.

        Specified by:
        outputUrl in interface ParseRun._FinalStage
      • output

        public ParseRun._FinalStage output​(Nullable<ParseRunOutput> output)

        The parse run output.

        Availability: Present when status is "PROCESSED" and the request was made without the responseType=url query parameter. Contains the parsed chunks.

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

        public ParseRun._FinalStage output​(ParseRunOutput output)

        The parse run output.

        Availability: Present when status is "PROCESSED" and the request was made without the responseType=url query parameter. Contains the parsed chunks.

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

        public ParseRun._FinalStage output​(java.util.Optional<ParseRunOutput> output)

        The parse run output.

        Availability: Present when status is "PROCESSED" and the request was made without the responseType=url query parameter. Contains the parsed chunks.

        Specified by:
        output in interface ParseRun._FinalStage
      • failureMessage

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

        A human-readable description of the failure.

        Availability: Present when status is "FAILED".

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

        public ParseRun._FinalStage failureMessage​(java.lang.String failureMessage)

        A human-readable description of the failure.

        Availability: Present when status is "FAILED".

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

        public ParseRun._FinalStage failureMessage​(java.util.Optional<java.lang.String> failureMessage)

        A human-readable description of the failure.

        Availability: Present when status is "FAILED".

        Specified by:
        failureMessage in interface ParseRun._FinalStage
      • failureReason

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

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - The file could not be downloaded from the provided URL
        • FILE_TYPE_NOT_SUPPORTED - The file type is not supported for parsing
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted or malformed
        • OCR_ERROR - An error occurred during optical character recognition
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be processed
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • FAILED_TO_CONVERT_TO_JPEG - The file could not be converted to JPEG for processing
        • FAILED_TO_GENERATE_TARGET_FORMAT - The output could not be generated in the requested format
        • CHUNKING_ERROR - An error occurred while chunking the document
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_CONFIG_OPTIONS - The provided configuration options are invalid
        • OUT_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:
        failureReason in interface ParseRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • failureReason

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

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - The file could not be downloaded from the provided URL
        • FILE_TYPE_NOT_SUPPORTED - The file type is not supported for parsing
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted or malformed
        • OCR_ERROR - An error occurred during optical character recognition
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be processed
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • FAILED_TO_CONVERT_TO_JPEG - The file could not be converted to JPEG for processing
        • FAILED_TO_GENERATE_TARGET_FORMAT - The output could not be generated in the requested format
        • CHUNKING_ERROR - An error occurred while chunking the document
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_CONFIG_OPTIONS - The provided configuration options are invalid
        • OUT_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:
        failureReason in interface ParseRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • failureReason

        public ParseRun._FinalStage failureReason​(java.util.Optional<java.lang.String> failureReason)

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - The file could not be downloaded from the provided URL
        • FILE_TYPE_NOT_SUPPORTED - The file type is not supported for parsing
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted or malformed
        • OCR_ERROR - An error occurred during optical character recognition
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be processed
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • FAILED_TO_CONVERT_TO_JPEG - The file could not be converted to JPEG for processing
        • FAILED_TO_GENERATE_TARGET_FORMAT - The output could not be generated in the requested format
        • CHUNKING_ERROR - An error occurred while chunking the document
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_CONFIG_OPTIONS - The provided configuration options are invalid
        • OUT_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:
        failureReason in interface ParseRun._FinalStage