From ae6aa37b65e27753a83302926746741dd5146520 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 18:30:30 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 3.34.8 --- .fern/metadata.json | 4 +- build.gradle | 6 +- reference.md | 2 +- .../java/ai/extend/core/ClientOptions.java | 4 +- .../AsyncRawWorkflowRunsClient.java | 4 +- .../workflowruns/AsyncWorkflowRunsClient.java | 4 +- .../workflowruns/RawWorkflowRunsClient.java | 4 +- .../workflowruns/WorkflowRunsClient.java | 4 +- .../java/ai/extend/types/ParseRunOutput.java | 62 +++- .../extend/types/ParseRunOutputMetadata.java | 227 +++++++++++++ .../ParseRunOutputMetadataPagesItem.java | 297 ++++++++++++++++++ .../types/ParseRunOutputOcrWordsItem.java | 52 ++- .../ai/extend/types/WorkflowRunPackage.java | 4 +- 13 files changed, 649 insertions(+), 25 deletions(-) create mode 100644 src/main/java/ai/extend/types/ParseRunOutputMetadata.java create mode 100644 src/main/java/ai/extend/types/ParseRunOutputMetadataPagesItem.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 573862c..4408b1d 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -18,6 +18,6 @@ "testImplementation org.mockito:mockito-inline:4.11.0" ] }, - "originGitCommit": "a5c1143a7b724689db7c5e4cee897834882c9d69", - "sdkVersion": "1.18.0" + "originGitCommit": "204f01f5a6e9ad6585d71b0ad6315aef1be1f537", + "sdkVersion": "1.19.0" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index c5db996..a8e46d0 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ java { group = 'ai.extend' -version = '1.18.0' +version = '1.19.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -81,11 +81,11 @@ publishing { maven(MavenPublication) { groupId = 'ai.extend' artifactId = 'extend-java-sdk' - version = '1.18.0' + version = '1.19.0' from components.java pom { name = 'Extend.ai' - description = 'The Java SDK for Extend.ai' + description = 'Official Java SDK for Extend (extend.ai) — the document processing API. Parse, extract, classify, split, and edit PDFs and 35+ file types' url = 'https://docs.extend.ai/2026-02-09/api-reference' licenses { license { diff --git a/reference.md b/reference.md index f6b0daa..d3c35c1 100644 --- a/reference.md +++ b/reference.md @@ -6715,7 +6715,7 @@ Example: `"invoice"` Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. -Pass `file` for a single document, or `package` to process 2-50 files together as one package in a single run. Exactly one of `file` or `package` must be provided. +Pass `file` for a single document use case (more common), or `package` to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of `file` or `package` must be provided. The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Workflow Run endpoint for results. diff --git a/src/main/java/ai/extend/core/ClientOptions.java b/src/main/java/ai/extend/core/ClientOptions.java index 4d1b8f6..642879c 100644 --- a/src/main/java/ai/extend/core/ClientOptions.java +++ b/src/main/java/ai/extend/core/ClientOptions.java @@ -35,10 +35,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "ai.extend:extend-java-sdk/1.18.0"); + put("User-Agent", "ai.extend:extend-java-sdk/1.19.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.extendconfig.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.18.0"); + put("X-Fern-SDK-Version", "1.19.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/ai/extend/resources/workflowruns/AsyncRawWorkflowRunsClient.java b/src/main/java/ai/extend/resources/workflowruns/AsyncRawWorkflowRunsClient.java index 2b712fb..3aa676f 100644 --- a/src/main/java/ai/extend/resources/workflowruns/AsyncRawWorkflowRunsClient.java +++ b/src/main/java/ai/extend/resources/workflowruns/AsyncRawWorkflowRunsClient.java @@ -211,7 +211,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public CompletableFuture> create(WorkflowRunsCreateRequest request) { @@ -220,7 +220,7 @@ public CompletableFuture> create(Workf /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public CompletableFuture> create( diff --git a/src/main/java/ai/extend/resources/workflowruns/AsyncWorkflowRunsClient.java b/src/main/java/ai/extend/resources/workflowruns/AsyncWorkflowRunsClient.java index fb865ec..abeb5c2 100644 --- a/src/main/java/ai/extend/resources/workflowruns/AsyncWorkflowRunsClient.java +++ b/src/main/java/ai/extend/resources/workflowruns/AsyncWorkflowRunsClient.java @@ -66,7 +66,7 @@ public CompletableFuture list( /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public CompletableFuture create(WorkflowRunsCreateRequest request) { @@ -75,7 +75,7 @@ public CompletableFuture create(WorkflowRunsCreateRequest request) /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public CompletableFuture create(WorkflowRunsCreateRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/ai/extend/resources/workflowruns/RawWorkflowRunsClient.java b/src/main/java/ai/extend/resources/workflowruns/RawWorkflowRunsClient.java index 9ed0b6c..00a8aa7 100644 --- a/src/main/java/ai/extend/resources/workflowruns/RawWorkflowRunsClient.java +++ b/src/main/java/ai/extend/resources/workflowruns/RawWorkflowRunsClient.java @@ -176,7 +176,7 @@ public ExtendClientBaseHttpResponse list( /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public ExtendClientBaseHttpResponse create(WorkflowRunsCreateRequest request) { @@ -185,7 +185,7 @@ public ExtendClientBaseHttpResponse create(WorkflowRunsCreateReques /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public ExtendClientBaseHttpResponse create( diff --git a/src/main/java/ai/extend/resources/workflowruns/WorkflowRunsClient.java b/src/main/java/ai/extend/resources/workflowruns/WorkflowRunsClient.java index 116a42c..8ebbde8 100644 --- a/src/main/java/ai/extend/resources/workflowruns/WorkflowRunsClient.java +++ b/src/main/java/ai/extend/resources/workflowruns/WorkflowRunsClient.java @@ -64,7 +64,7 @@ public WorkflowRunsListResponse list(WorkflowRunsListRequest request, RequestOpt /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public WorkflowRun create(WorkflowRunsCreateRequest request) { @@ -73,7 +73,7 @@ public WorkflowRun create(WorkflowRunsCreateRequest request) { /** * Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. - *

Pass file for a single document, or package to process 2-50 files together as one package in a single run. Exactly one of file or package must be provided.

+ *

Pass file for a single document use case (more common), or package to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of file or package must be provided.

*

The request returns immediately with a PROCESSING status. Use webhooks or poll the Get Workflow Run endpoint for results.

*/ public WorkflowRun create(WorkflowRunsCreateRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/ai/extend/types/ParseRunOutput.java b/src/main/java/ai/extend/types/ParseRunOutput.java index 48528e2..3e08758 100644 --- a/src/main/java/ai/extend/types/ParseRunOutput.java +++ b/src/main/java/ai/extend/types/ParseRunOutput.java @@ -3,9 +3,12 @@ */ package ai.extend.types; +import ai.extend.core.Nullable; +import ai.extend.core.NullableNonemptyFilter; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,12 +29,18 @@ public final class ParseRunOutput { private final Optional ocr; + private final Optional metadata; + private final Map additionalProperties; private ParseRunOutput( - List chunks, Optional ocr, Map additionalProperties) { + List chunks, + Optional ocr, + Optional metadata, + Map additionalProperties) { this.chunks = chunks; this.ocr = ocr; + this.metadata = metadata; this.additionalProperties = additionalProperties; } @@ -51,6 +60,23 @@ public Optional getOcr() { return ocr; } + /** + * @return Rotation, dimension, and file-type metadata about the parse output. null for parse runs that completed before this field was introduced. + */ + @JsonIgnore + public Optional getMetadata() { + if (metadata == null) { + return Optional.empty(); + } + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("metadata") + private Optional _getMetadata() { + return metadata; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -63,12 +89,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ParseRunOutput other) { - return chunks.equals(other.chunks) && ocr.equals(other.ocr); + return chunks.equals(other.chunks) && ocr.equals(other.ocr) && metadata.equals(other.metadata); } @java.lang.Override public int hashCode() { - return Objects.hash(this.chunks, this.ocr); + return Objects.hash(this.chunks, this.ocr, this.metadata); } @java.lang.Override @@ -86,6 +112,8 @@ public static final class Builder { private Optional ocr = Optional.empty(); + private Optional metadata = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -94,6 +122,7 @@ private Builder() {} public Builder from(ParseRunOutput other) { chunks(other.getChunks()); ocr(other.getOcr()); + metadata(other.getMetadata()); return this; } @@ -135,8 +164,33 @@ public Builder ocr(ParseRunOutputOcr ocr) { return this; } + /** + *

Rotation, dimension, and file-type metadata about the parse output. null for parse runs that completed before this field was introduced.

+ */ + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(ParseRunOutputMetadata metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Nullable metadata) { + if (metadata.isNull()) { + this.metadata = null; + } else if (metadata.isEmpty()) { + this.metadata = Optional.empty(); + } else { + this.metadata = Optional.of(metadata.get()); + } + return this; + } + public ParseRunOutput build() { - return new ParseRunOutput(chunks, ocr, additionalProperties); + return new ParseRunOutput(chunks, ocr, metadata, additionalProperties); } } } diff --git a/src/main/java/ai/extend/types/ParseRunOutputMetadata.java b/src/main/java/ai/extend/types/ParseRunOutputMetadata.java new file mode 100644 index 0000000..f9b55c8 --- /dev/null +++ b/src/main/java/ai/extend/types/ParseRunOutputMetadata.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package ai.extend.types; + +import ai.extend.core.Nullable; +import ai.extend.core.NullableNonemptyFilter; +import ai.extend.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ParseRunOutputMetadata.Builder.class) +public final class ParseRunOutputMetadata { + private final Optional originalMimeType; + + private final Optional finalMimeType; + + private final Optional> pages; + + private final Map additionalProperties; + + private ParseRunOutputMetadata( + Optional originalMimeType, + Optional finalMimeType, + Optional> pages, + Map additionalProperties) { + this.originalMimeType = originalMimeType; + this.finalMimeType = finalMimeType; + this.pages = pages; + this.additionalProperties = additionalProperties; + } + + /** + * @return The file's media type before any format conversion. + */ + @JsonIgnore + public Optional getOriginalMimeType() { + if (originalMimeType == null) { + return Optional.empty(); + } + return originalMimeType; + } + + /** + * @return The file's media type after any format conversion. + */ + @JsonIgnore + public Optional getFinalMimeType() { + if (finalMimeType == null) { + return Optional.empty(); + } + return finalMimeType; + } + + /** + * @return Per-page rotation and original-dimension info. Set when file is a PDF or was converted to PDF. + */ + @JsonIgnore + public Optional> getPages() { + if (pages == null) { + return Optional.empty(); + } + return pages; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("originalMimeType") + private Optional _getOriginalMimeType() { + return originalMimeType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("finalMimeType") + private Optional _getFinalMimeType() { + return finalMimeType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pages") + private Optional> _getPages() { + return pages; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ParseRunOutputMetadata && equalTo((ParseRunOutputMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ParseRunOutputMetadata other) { + return originalMimeType.equals(other.originalMimeType) + && finalMimeType.equals(other.finalMimeType) + && pages.equals(other.pages); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.originalMimeType, this.finalMimeType, this.pages); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional originalMimeType = Optional.empty(); + + private Optional finalMimeType = Optional.empty(); + + private Optional> pages = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ParseRunOutputMetadata other) { + originalMimeType(other.getOriginalMimeType()); + finalMimeType(other.getFinalMimeType()); + pages(other.getPages()); + return this; + } + + /** + *

The file's media type before any format conversion.

+ */ + @JsonSetter(value = "originalMimeType", nulls = Nulls.SKIP) + public Builder originalMimeType(Optional originalMimeType) { + this.originalMimeType = originalMimeType; + return this; + } + + public Builder originalMimeType(String originalMimeType) { + this.originalMimeType = Optional.ofNullable(originalMimeType); + return this; + } + + public Builder originalMimeType(Nullable originalMimeType) { + if (originalMimeType.isNull()) { + this.originalMimeType = null; + } else if (originalMimeType.isEmpty()) { + this.originalMimeType = Optional.empty(); + } else { + this.originalMimeType = Optional.of(originalMimeType.get()); + } + return this; + } + + /** + *

The file's media type after any format conversion.

+ */ + @JsonSetter(value = "finalMimeType", nulls = Nulls.SKIP) + public Builder finalMimeType(Optional finalMimeType) { + this.finalMimeType = finalMimeType; + return this; + } + + public Builder finalMimeType(String finalMimeType) { + this.finalMimeType = Optional.ofNullable(finalMimeType); + return this; + } + + public Builder finalMimeType(Nullable finalMimeType) { + if (finalMimeType.isNull()) { + this.finalMimeType = null; + } else if (finalMimeType.isEmpty()) { + this.finalMimeType = Optional.empty(); + } else { + this.finalMimeType = Optional.of(finalMimeType.get()); + } + return this; + } + + /** + *

Per-page rotation and original-dimension info. Set when file is a PDF or was converted to PDF.

+ */ + @JsonSetter(value = "pages", nulls = Nulls.SKIP) + public Builder pages(Optional> pages) { + this.pages = pages; + return this; + } + + public Builder pages(List pages) { + this.pages = Optional.ofNullable(pages); + return this; + } + + public Builder pages(Nullable> pages) { + if (pages.isNull()) { + this.pages = null; + } else if (pages.isEmpty()) { + this.pages = Optional.empty(); + } else { + this.pages = Optional.of(pages.get()); + } + return this; + } + + public ParseRunOutputMetadata build() { + return new ParseRunOutputMetadata(originalMimeType, finalMimeType, pages, additionalProperties); + } + } +} diff --git a/src/main/java/ai/extend/types/ParseRunOutputMetadataPagesItem.java b/src/main/java/ai/extend/types/ParseRunOutputMetadataPagesItem.java new file mode 100644 index 0000000..c6647ca --- /dev/null +++ b/src/main/java/ai/extend/types/ParseRunOutputMetadataPagesItem.java @@ -0,0 +1,297 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package ai.extend.types; + +import ai.extend.core.Nullable; +import ai.extend.core.NullableNonemptyFilter; +import ai.extend.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ParseRunOutputMetadataPagesItem.Builder.class) +public final class ParseRunOutputMetadataPagesItem { + private final int number; + + private final Optional rotationApplied; + + private final double originalPageWidth; + + private final double originalPageHeight; + + private final double dpi; + + private final Map additionalProperties; + + private ParseRunOutputMetadataPagesItem( + int number, + Optional rotationApplied, + double originalPageWidth, + double originalPageHeight, + double dpi, + Map additionalProperties) { + this.number = number; + this.rotationApplied = rotationApplied; + this.originalPageWidth = originalPageWidth; + this.originalPageHeight = originalPageHeight; + this.dpi = dpi; + this.additionalProperties = additionalProperties; + } + + /** + * @return The page number this entry describes. + */ + @JsonProperty("number") + public int getNumber() { + return number; + } + + /** + * @return Degrees Extend rotated the page clockwise to make it upright. 0 if rotation detection ran and the page was already upright; null if rotation detection was disabled for this run. + */ + @JsonIgnore + public Optional getRotationApplied() { + if (rotationApplied == null) { + return Optional.empty(); + } + return rotationApplied; + } + + /** + * @return The file's true page width, independent of rendering resolution. + */ + @JsonProperty("originalPageWidth") + public double getOriginalPageWidth() { + return originalPageWidth; + } + + /** + * @return The file's true page height, independent of rendering resolution. + */ + @JsonProperty("originalPageHeight") + public double getOriginalPageHeight() { + return originalPageHeight; + } + + /** + * @return The DPI that boundingBox/polygon coordinates on this page are scaled to. Multiply originalPageWidth/originalPageHeight by dpi / 72 to convert them into that same coordinate space. + */ + @JsonProperty("dpi") + public double getDpi() { + return dpi; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rotationApplied") + private Optional _getRotationApplied() { + return rotationApplied; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ParseRunOutputMetadataPagesItem && equalTo((ParseRunOutputMetadataPagesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ParseRunOutputMetadataPagesItem other) { + return number == other.number + && rotationApplied.equals(other.rotationApplied) + && originalPageWidth == other.originalPageWidth + && originalPageHeight == other.originalPageHeight + && dpi == other.dpi; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.number, this.rotationApplied, this.originalPageWidth, this.originalPageHeight, this.dpi); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NumberStage builder() { + return new Builder(); + } + + public interface NumberStage { + /** + *

The page number this entry describes.

+ */ + OriginalPageWidthStage number(int number); + + Builder from(ParseRunOutputMetadataPagesItem other); + } + + public interface OriginalPageWidthStage { + /** + *

The file's true page width, independent of rendering resolution.

+ */ + OriginalPageHeightStage originalPageWidth(double originalPageWidth); + } + + public interface OriginalPageHeightStage { + /** + *

The file's true page height, independent of rendering resolution.

+ */ + DpiStage originalPageHeight(double originalPageHeight); + } + + public interface DpiStage { + /** + *

The DPI that boundingBox/polygon coordinates on this page are scaled to. Multiply originalPageWidth/originalPageHeight by dpi / 72 to convert them into that same coordinate space.

+ */ + _FinalStage dpi(double dpi); + } + + public interface _FinalStage { + ParseRunOutputMetadataPagesItem build(); + + /** + *

Degrees Extend rotated the page clockwise to make it upright. 0 if rotation detection ran and the page was already upright; null if rotation detection was disabled for this run.

+ */ + _FinalStage rotationApplied(Optional rotationApplied); + + _FinalStage rotationApplied(Integer rotationApplied); + + _FinalStage rotationApplied(Nullable rotationApplied); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NumberStage, OriginalPageWidthStage, OriginalPageHeightStage, DpiStage, _FinalStage { + private int number; + + private double originalPageWidth; + + private double originalPageHeight; + + private double dpi; + + private Optional rotationApplied = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ParseRunOutputMetadataPagesItem other) { + number(other.getNumber()); + rotationApplied(other.getRotationApplied()); + originalPageWidth(other.getOriginalPageWidth()); + originalPageHeight(other.getOriginalPageHeight()); + dpi(other.getDpi()); + return this; + } + + /** + *

The page number this entry describes.

+ *

The page number this entry describes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("number") + public OriginalPageWidthStage number(int number) { + this.number = number; + return this; + } + + /** + *

The file's true page width, independent of rendering resolution.

+ *

The file's true page width, independent of rendering resolution.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("originalPageWidth") + public OriginalPageHeightStage originalPageWidth(double originalPageWidth) { + this.originalPageWidth = originalPageWidth; + return this; + } + + /** + *

The file's true page height, independent of rendering resolution.

+ *

The file's true page height, independent of rendering resolution.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("originalPageHeight") + public DpiStage originalPageHeight(double originalPageHeight) { + this.originalPageHeight = originalPageHeight; + return this; + } + + /** + *

The DPI that boundingBox/polygon coordinates on this page are scaled to. Multiply originalPageWidth/originalPageHeight by dpi / 72 to convert them into that same coordinate space.

+ *

The DPI that boundingBox/polygon coordinates on this page are scaled to. Multiply originalPageWidth/originalPageHeight by dpi / 72 to convert them into that same coordinate space.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("dpi") + public _FinalStage dpi(double dpi) { + this.dpi = dpi; + return this; + } + + /** + *

Degrees Extend rotated the page clockwise to make it upright. 0 if rotation detection ran and the page was already upright; null if rotation detection was disabled for this run.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rotationApplied(Nullable rotationApplied) { + if (rotationApplied.isNull()) { + this.rotationApplied = null; + } else if (rotationApplied.isEmpty()) { + this.rotationApplied = Optional.empty(); + } else { + this.rotationApplied = Optional.of(rotationApplied.get()); + } + return this; + } + + /** + *

Degrees Extend rotated the page clockwise to make it upright. 0 if rotation detection ran and the page was already upright; null if rotation detection was disabled for this run.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rotationApplied(Integer rotationApplied) { + this.rotationApplied = Optional.ofNullable(rotationApplied); + return this; + } + + /** + *

Degrees Extend rotated the page clockwise to make it upright. 0 if rotation detection ran and the page was already upright; null if rotation detection was disabled for this run.

+ */ + @java.lang.Override + @JsonSetter(value = "rotationApplied", nulls = Nulls.SKIP) + public _FinalStage rotationApplied(Optional rotationApplied) { + this.rotationApplied = rotationApplied; + return this; + } + + @java.lang.Override + public ParseRunOutputMetadataPagesItem build() { + return new ParseRunOutputMetadataPagesItem( + number, rotationApplied, originalPageWidth, originalPageHeight, dpi, additionalProperties); + } + } +} diff --git a/src/main/java/ai/extend/types/ParseRunOutputOcrWordsItem.java b/src/main/java/ai/extend/types/ParseRunOutputOcrWordsItem.java index 22e424f..2f0283e 100644 --- a/src/main/java/ai/extend/types/ParseRunOutputOcrWordsItem.java +++ b/src/main/java/ai/extend/types/ParseRunOutputOcrWordsItem.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -27,6 +29,8 @@ public final class ParseRunOutputOcrWordsItem { private final double pageNumber; + private final Optional blockId; + private final Map additionalProperties; private ParseRunOutputOcrWordsItem( @@ -34,11 +38,13 @@ private ParseRunOutputOcrWordsItem( BoundingBox boundingBox, double confidence, double pageNumber, + Optional blockId, Map additionalProperties) { this.content = content; this.boundingBox = boundingBox; this.confidence = confidence; this.pageNumber = pageNumber; + this.blockId = blockId; this.additionalProperties = additionalProperties; } @@ -74,6 +80,14 @@ public double getPageNumber() { return pageNumber; } + /** + * @return The id of the block (see the Block schema) this word was assigned to, based on bounding-box overlap. Omitted when the word doesn't fall within any block's bounding box. + */ + @JsonProperty("blockId") + public Optional getBlockId() { + return blockId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -89,12 +103,13 @@ private boolean equalTo(ParseRunOutputOcrWordsItem other) { return content.equals(other.content) && boundingBox.equals(other.boundingBox) && confidence == other.confidence - && pageNumber == other.pageNumber; + && pageNumber == other.pageNumber + && blockId.equals(other.blockId); } @java.lang.Override public int hashCode() { - return Objects.hash(this.content, this.boundingBox, this.confidence, this.pageNumber); + return Objects.hash(this.content, this.boundingBox, this.confidence, this.pageNumber, this.blockId); } @java.lang.Override @@ -138,6 +153,13 @@ public interface PageNumberStage { public interface _FinalStage { ParseRunOutputOcrWordsItem build(); + + /** + *

The id of the block (see the Block schema) this word was assigned to, based on bounding-box overlap. Omitted when the word doesn't fall within any block's bounding box.

+ */ + _FinalStage blockId(Optional blockId); + + _FinalStage blockId(String blockId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -151,6 +173,8 @@ public static final class Builder private double pageNumber; + private Optional blockId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,6 +186,7 @@ public Builder from(ParseRunOutputOcrWordsItem other) { boundingBox(other.getBoundingBox()); confidence(other.getConfidence()); pageNumber(other.getPageNumber()); + blockId(other.getBlockId()); return this; } @@ -213,9 +238,30 @@ public _FinalStage pageNumber(double pageNumber) { return this; } + /** + *

The id of the block (see the Block schema) this word was assigned to, based on bounding-box overlap. Omitted when the word doesn't fall within any block's bounding box.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage blockId(String blockId) { + this.blockId = Optional.ofNullable(blockId); + return this; + } + + /** + *

The id of the block (see the Block schema) this word was assigned to, based on bounding-box overlap. Omitted when the word doesn't fall within any block's bounding box.

+ */ + @java.lang.Override + @JsonSetter(value = "blockId", nulls = Nulls.SKIP) + public _FinalStage blockId(Optional blockId) { + this.blockId = blockId; + return this; + } + @java.lang.Override public ParseRunOutputOcrWordsItem build() { - return new ParseRunOutputOcrWordsItem(content, boundingBox, confidence, pageNumber, additionalProperties); + return new ParseRunOutputOcrWordsItem( + content, boundingBox, confidence, pageNumber, blockId, additionalProperties); } } } diff --git a/src/main/java/ai/extend/types/WorkflowRunPackage.java b/src/main/java/ai/extend/types/WorkflowRunPackage.java index a5bca0c..e189dc2 100644 --- a/src/main/java/ai/extend/types/WorkflowRunPackage.java +++ b/src/main/java/ai/extend/types/WorkflowRunPackage.java @@ -31,7 +31,7 @@ private WorkflowRunPackage(List files, MapDuplicate file IDs and duplicate URLs are rejected — each file may appear only once. A URL and a file ID are never treated as duplicates of each other, even if they resolve to the same document.

*/ @JsonProperty("files") @@ -83,7 +83,7 @@ public Builder from(WorkflowRunPackage other) { } /** - *

The files to process, in submission order. Each entry can be a URL or an existing Extend file ID. Raw text and base64 inputs are not supported for package runs.

+ *

The files to process. Each entry can be a URL or an existing Extend file ID. Raw text and base64 inputs are not supported for package runs.

*

Duplicate file IDs and duplicate URLs are rejected — each file may appear only once. A URL and a file ID are never treated as duplicates of each other, even if they resolve to the same document.

*/ @JsonSetter(value = "files", nulls = Nulls.SKIP) From 0fdf3f80e1593b1ab1e3fd8f1ef18e39dc67ad20 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 18:30:30 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index b4fe821..9537c1e 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -18,5 +18,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-java-sdk: 3.34.8 -current_generation: cb33baf0976726bbd6feeceee5856bb63a0c02ae + - commit_sha: 7bd23f89ba471b8f051564387b0ad8823a8af293 + tree_hash: bea76c30720142688a6404ded1e07447980fc04b + timestamp: 2026-08-10T18:30:27.962Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 3.34.8 +current_generation: 7bd23f89ba471b8f051564387b0ad8823a8af293 patches: []