Class EditRun.Builder

    • Method Detail

      • 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:
        id in interface EditRun.IdStage
        Returns:
        Reference to this so 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:
        file in interface EditRun.FileStage
        Returns:
        Reference to this so 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 (see failureReason for details)

        The status of the edit run:

        • "PROCESSING" - The file is still being processed
        • "PROCESSED" - The file was successfully edited
        • "FAILED" - The editing failed (see failureReason for details)
        Specified by:
        status in interface EditRun.StatusStage
        Returns:
        Reference to this so 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:
        config in interface EditRun.ConfigStage
        Returns:
        Reference to this so that method calls can be chained together.
      • usage

        public EditRun._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 EditRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • usage

        public EditRun._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 EditRun._FinalStage
        Returns:
        Reference to this so 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 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 EditRun._FinalStage
      • failureMessage

        public EditRun._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 EditRun._FinalStage
        Returns:
        Reference to this so 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 status is "FAILED".

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

        Specified by:
        failureMessage in interface EditRun._FinalStage
      • failureReason

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

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - Failed to load the requested file
        • FILE_TYPE_NOT_SUPPORTED - File type not supported. Edit runs currently require a PDF
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted and cannot be edited
        • FIELD_DETECTION_ERROR - An error occurred during field detection
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be edited
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_OPTIONS - The provided configuration options are invalid
        • EMPTY_SCHEMA - No schema was provided and no fields could be detected
        • 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 EditRun._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • failureReason

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

        The reason for failure.

        Availability: Present when status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - Failed to load the requested file
        • FILE_TYPE_NOT_SUPPORTED - File type not supported. Edit runs currently require a PDF
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted and cannot be edited
        • FIELD_DETECTION_ERROR - An error occurred during field detection
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be edited
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_OPTIONS - The provided configuration options are invalid
        • EMPTY_SCHEMA - No schema was provided and no fields could be detected
        • 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 EditRun._FinalStage
        Returns:
        Reference to this so 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 status is "FAILED".

        Possible values include:

        • UNABLE_TO_DOWNLOAD_FILE - Failed to load the requested file
        • FILE_TYPE_NOT_SUPPORTED - File type not supported. Edit runs currently require a PDF
        • FILE_SIZE_TOO_LARGE - The file exceeds the maximum allowed size
        • CORRUPT_FILE - The file appears to be corrupted and cannot be edited
        • FIELD_DETECTION_ERROR - An error occurred during field detection
        • PASSWORD_PROTECTED_FILE - The file is password protected and cannot be edited
        • FAILED_TO_CONVERT_TO_PDF - The file could not be converted to PDF for processing
        • INTERNAL_ERROR - An unexpected internal error occurred
        • INVALID_OPTIONS - The provided configuration options are invalid
        • EMPTY_SCHEMA - No schema was provided and no fields could be detected
        • 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 EditRun._FinalStage